Merge "Add @covers for includes/shell/ tests"
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index ee0da2a..f99089b 100644 (file)
@@ -869,6 +869,7 @@ class ParserOptions {
 
        /**
         * Create "edit section" links?
+        * @deprecated since 1.31, use ParserOutput::getText() options instead.
         * @return bool
         */
        public function getEditSection() {
@@ -877,6 +878,7 @@ class ParserOptions {
 
        /**
         * Create "edit section" links?
+        * @deprecated since 1.31, use ParserOutput::getText() options instead.
         * @param bool|null $x New value (null is no change)
         * @return bool Old value
         */
@@ -944,6 +946,9 @@ class ParserOptions {
                }
                if ( $lang === null ) {
                        global $wgLang;
+                       if ( !StubObject::isRealObject( $wgLang ) ) {
+                               $wgLang->_unstub();
+                       }
                        $lang = $wgLang;
                }
                $this->initialiseFromUser( $user, $lang );
@@ -1011,7 +1016,7 @@ class ParserOptions {
         *
         * @since 1.30
         * @param User|null $user
-        * @param Language|null $lang
+        * @param Language|StubObject|null $lang
         * @return ParserOptions
         */
        public static function newCanonical( User $user = null, $lang = null ) {
@@ -1059,13 +1064,11 @@ class ParserOptions {
                                'speculativeRevIdCallback' => null,
                        ];
 
-                       // @codingStandardsIgnoreStart Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfterAmp
                        Hooks::run( 'ParserOptionsRegister', [
                                &self::$defaults,
                                &self::$inCacheKey,
                                &self::$lazyOptions,
                        ] );
-                       // @codingStandardsIgnoreEnd
 
                        ksort( self::$inCacheKey );
                }