Document Parser::$mFirstCall
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 2 Aug 2018 08:57:53 +0000 (01:57 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 2 Aug 2018 08:57:53 +0000 (01:57 -0700)
And don't bother checking its value in clearState(), since firstCallInit()
will do that anyways.

Change-Id: Ibc5e809daa614e99be91d65a363de4f697e6afa5

includes/parser/Parser.php

index 2778ea6..bd7d4ac 100644 (file)
@@ -153,6 +153,9 @@ class Parser {
        public $mImageParams = [];
        public $mImageParamsMagicArray = [];
        public $mMarkerIndex = 0;
+       /**
+        * @var bool Whether firstCallInit still needs to be called
+        */
        public $mFirstCall = true;
 
        # Initialised by initialiseVariables()
@@ -354,9 +357,7 @@ class Parser {
         * @private
         */
        public function clearState() {
-               if ( $this->mFirstCall ) {
-                       $this->firstCallInit();
-               }
+               $this->firstCallInit();
                $this->mOutput = new ParserOutput;
                $this->mOptions->registerWatcher( [ $this->mOutput, 'recordOption' ] );
                $this->mAutonumber = 0;