Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index a19f86c..b27338c 100644 (file)
@@ -411,8 +411,10 @@ class Parser {
         */
        public function __destruct() {
                if ( isset( $this->mLinkHolders ) ) {
+                       // @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty
                        unset( $this->mLinkHolders );
                }
+               // @phan-suppress-next-line PhanTypeSuspiciousNonTraversableForeach
                foreach ( $this as $name => $value ) {
                        unset( $this->$name );
                }
@@ -2008,6 +2010,7 @@ class Parser {
         */
        public function replaceExternalLinks( $text ) {
                $bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
+               // @phan-suppress-next-line PhanTypeComparisonFromArray See phan issue #3161
                if ( $bits === false ) {
                        throw new MWException( "PCRE needs to be compiled with "
                                . "--enable-unicode-properties in order for MediaWiki to function" );
@@ -6187,7 +6190,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" );