Merge "Display MAX_CHARS / MAX_BYTES in ApiSandbox"
[lhc/web/wiklou.git] / includes / title / TitleValue.php
index 597bf2f..77c1953 100644 (file)
@@ -34,22 +34,27 @@ use Wikimedia\Assert\Assert;
  * @since 1.23
  */
 class TitleValue implements LinkTarget {
+
        /**
+        * @deprecated in 1.31. This class is immutable. Use the getter for access.
         * @var int
         */
        protected $namespace;
 
        /**
+        * @deprecated in 1.31. This class is immutable. Use the getter for access.
         * @var string
         */
        protected $dbkey;
 
        /**
+        * @deprecated in 1.31. This class is immutable. Use the getter for access.
         * @var string
         */
        protected $fragment;
 
        /**
+        * @deprecated in 1.31. This class is immutable. Use the getter for access.
         * @var string
         */
        protected $interwiki;
@@ -78,7 +83,8 @@ class TitleValue implements LinkTarget {
                Assert::parameterType( 'string', $interwiki, '$interwiki' );
 
                // Sanity check, no full validation or normalization applied here!
-               Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), '$dbkey', 'invalid DB key' );
+               Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), '$dbkey',
+                       "invalid DB key '$dbkey'" );
                Assert::parameter( $dbkey !== '', '$dbkey', 'should not be empty' );
 
                $this->namespace = $namespace;
@@ -88,6 +94,7 @@ class TitleValue implements LinkTarget {
        }
 
        /**
+        * @since 1.23
         * @return int
         */
        public function getNamespace() {
@@ -104,6 +111,7 @@ class TitleValue implements LinkTarget {
        }
 
        /**
+        * @since 1.23
         * @return string
         */
        public function getFragment() {
@@ -121,6 +129,7 @@ class TitleValue implements LinkTarget {
        /**
         * Returns the title's DB key, as supplied to the constructor,
         * without namespace prefix or fragment.
+        * @since 1.23
         *
         * @return string
         */
@@ -131,6 +140,7 @@ class TitleValue implements LinkTarget {
        /**
         * Returns the title in text form,
         * without namespace prefix or fragment.
+        * @since 1.23
         *
         * This is computed from the DB key by replacing any underscores with spaces.
         *
@@ -184,6 +194,7 @@ class TitleValue implements LinkTarget {
         * Returns a string representation of the title, for logging. This is purely informative
         * and must not be used programmatically. Use the appropriate TitleFormatter to generate
         * the correct string representation for a given use.
+        * @since 1.23
         *
         * @return string
         */