Revert "Parser: Add Title type hints"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 9ec5834..ae77c4e 100644 (file)
@@ -228,7 +228,7 @@ class Parser {
        public $mOptions;
 
        /**
-        * @var Title
+        * @var Title|null Beware - this is not always set
         */
        public $mTitle;        # Title context, used for self-link rendering and similar things
        public $mOutputType;   # Output type, one of the OT_xxx constants
@@ -906,9 +906,9 @@ class Parser {
        /**
         * Set the context title
         *
-        * @param Title $t
+        * @param Title|null $t
         */
-       public function setTitle( $t ) {
+       public function setTitle( Title $t = null ) {
                if ( !$t ) {
                        $t = Title::makeTitle( NS_SPECIAL, 'Badtitle/Parser' );
                }
@@ -926,7 +926,7 @@ class Parser {
         *
         * @return Title|null
         */
-       public function getTitle() {
+       public function getTitle() : ?Title {
                return $this->mTitle;
        }
 
@@ -934,9 +934,9 @@ class Parser {
         * Accessor/mutator for the Title object
         *
         * @param Title|null $x Title object or null to just get the current one
-        * @return Title
+        * @return Title|null
         */
-       public function Title( $x = null ) {
+       public function Title( Title $x = null ) : ?Title {
                return wfSetVar( $this->mTitle, $x );
        }