Merge "LogPager: separate getter from query filter"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 962313e..ec1628f 100644 (file)
@@ -2312,6 +2312,11 @@ class Parser {
                $line = $a->current(); # Workaround for broken ArrayIterator::next() that returns "void"
                $s = substr( $s, 1 );
 
+               if ( is_null( $this->mTitle ) ) {
+                       throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" );
+               }
+               $nottalk = !$this->mTitle->isTalkPage();
+
                $useLinkPrefixExtension = $this->getTargetLanguage()->linkPrefixExtension();
                $e2 = null;
                if ( $useLinkPrefixExtension ) {
@@ -2319,14 +2324,6 @@ class Parser {
                        # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
                        $charset = $this->contLang->linkPrefixCharset();
                        $e2 = "/^((?>.*[^$charset]|))(.+)$/sDu";
-               }
-
-               if ( is_null( $this->mTitle ) ) {
-                       throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" );
-               }
-               $nottalk = !$this->mTitle->isTalkPage();
-
-               if ( $useLinkPrefixExtension ) {
                        $m = [];
                        if ( preg_match( $e2, $s, $m ) ) {
                                $first_prefix = $m[2];
@@ -4271,7 +4268,6 @@ class Parser {
         * @param bool $isMain
         * @return mixed|string
         * @private
-        * @suppress PhanTypeInvalidDimOffset
         */
        public function formatHeadings( $text, $origText, $isMain = true ) {
                # Inhibit editsection links if requested in the page
@@ -5578,7 +5574,6 @@ class Parser {
                Hooks::run( 'ParserMakeImageParams', [ $title, $file, &$params, $this ] );
 
                # Linker does the rest
-               // @phan-suppress-next-line PhanTypeInvalidDimOffset
                $time = $options['time'] ?? false;
                $ret = Linker::makeImageLink( $this, $title, $file, $params['frame'], $params['handler'],
                        $time, $descQuery, $this->mOptions->getThumbSize() );
@@ -6192,7 +6187,9 @@ class Parser {
         */
        private static function normalizeSectionName( $text ) {
                # T90902: ensure the same normalization is applied for IDs as to links
+               /** @var MediaWikiTitleCodec $titleParser */
                $titleParser = MediaWikiServices::getInstance()->getTitleParser();
+               '@phan-var MediaWikiTitleCodec $titleParser';
                try {
 
                        $parts = $titleParser->splitTitleString( "#$text" );