Merge "Rewrite pref cleanup script"
[lhc/web/wiklou.git] / includes / title / TitleValue.php
index 597bf2f..3e13300 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Representation of a page title within %MediaWiki.
+ * Representation of a page title within MediaWiki.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Daniel Kinzler
  */
 use MediaWiki\Linker\LinkTarget;
 use Wikimedia\Assert\Assert;
 
 /**
- * Represents a page (or page fragment) title within %MediaWiki.
+ * Represents a page (or page fragment) title within MediaWiki.
  *
  * @note In contrast to Title, this is designed to be a plain value object. That is,
  * it is immutable, does not use global state, and causes no side effects.
@@ -34,22 +33,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 +82,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 +93,7 @@ class TitleValue implements LinkTarget {
        }
 
        /**
+        * @since 1.23
         * @return int
         */
        public function getNamespace() {
@@ -104,6 +110,7 @@ class TitleValue implements LinkTarget {
        }
 
        /**
+        * @since 1.23
         * @return string
         */
        public function getFragment() {
@@ -121,6 +128,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 +139,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 +193,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
         */