Merge "Parser: Call firstCallInit() in getTags/getFunctionHooks"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 15 Aug 2018 00:49:40 +0000 (00:49 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 15 Aug 2018 00:49:40 +0000 (00:49 +0000)
includes/api/ApiQuerySiteinfo.php
includes/parser/Parser.php
tests/phpunit/includes/api/ApiQuerySiteinfoTest.php

index c26bb62..eaa3bc1 100644 (file)
@@ -784,7 +784,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
        public function appendExtensionTags( $property ) {
                global $wgParser;
-               $wgParser->firstCallInit();
                $tags = array_map(
                        function ( $item ) {
                                return "<$item>";
@@ -799,7 +798,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
        public function appendFunctionHooks( $property ) {
                global $wgParser;
-               $wgParser->firstCallInit();
                $hooks = $wgParser->getFunctionHooks();
                ApiResult::setArrayType( $hooks, 'BCarray' );
                ApiResult::setIndexedTagName( $hooks, 'h' );
index b1e3928..1fc2f92 100644 (file)
@@ -4926,6 +4926,7 @@ class Parser {
         * @return array
         */
        public function getFunctionHooks() {
+               $this->firstCallInit();
                return array_keys( $this->mFunctionHooks );
        }
 
@@ -5482,6 +5483,7 @@ class Parser {
         * @return array
         */
        public function getTags() {
+               $this->firstCallInit();
                return array_merge(
                        array_keys( $this->mTransparentTagHooks ),
                        array_keys( $this->mTagHooks ),
index 7b93571..fe2058f 100644 (file)
@@ -571,7 +571,6 @@ class ApiQuerySiteinfoTest extends ApiTestCase {
        public function testExtensionTags() {
                global $wgParser;
 
-               $wgParser->firstCallInit();
                $expected = array_map(
                        function ( $tag ) {
                                return "<$tag>";
@@ -585,7 +584,6 @@ class ApiQuerySiteinfoTest extends ApiTestCase {
        public function testFunctionHooks() {
                global $wgParser;
 
-               $wgParser->firstCallInit();
                $this->assertSame( $wgParser->getFunctionHooks(), $this->doQuery( 'functionhooks' ) );
        }