Merge "Begin exposing SiteConfiguration via site contexts"
[lhc/web/wiklou.git] / includes / context / RequestContext.php
index 2822c48..5f91731 100644 (file)
@@ -109,6 +109,7 @@ class RequestContext implements IContextSource {
                        global $wgRequest; # fallback to $wg till we can improve this
                        $this->request = $wgRequest;
                }
+
                return $this->request;
        }
 
@@ -116,6 +117,7 @@ class RequestContext implements IContextSource {
         * Set the Title object
         *
         * @param Title $t
+        * @throws MWException
         */
        public function setTitle( $t ) {
                if ( $t !== null && !$t instanceof Title ) {
@@ -136,6 +138,7 @@ class RequestContext implements IContextSource {
                        global $wgTitle; # fallback to $wg till we can improve this
                        $this->title = $wgTitle;
                }
+
                return $this->title;
        }
 
@@ -196,6 +199,7 @@ class RequestContext implements IContextSource {
                        }
                        $this->wikipage = WikiPage::factory( $title );
                }
+
                return $this->wikipage;
        }
 
@@ -215,6 +219,7 @@ class RequestContext implements IContextSource {
                if ( $this->output === null ) {
                        $this->output = new OutputPage( $this );
                }
+
                return $this->output;
        }
 
@@ -236,6 +241,7 @@ class RequestContext implements IContextSource {
                if ( $this->user === null ) {
                        $this->user = User::newFromSession( $this->getRequest() );
                }
+
                return $this->user;
        }
 
@@ -296,6 +302,7 @@ class RequestContext implements IContextSource {
         */
        public function getLang() {
                wfDeprecated( __METHOD__, '1.19' );
+
                return $this->getLanguage();
        }
 
@@ -391,6 +398,7 @@ class RequestContext implements IContextSource {
                        $this->skin->setContext( $this );
                        wfProfileOut( __METHOD__ . '-createskin' );
                }
+
                return $this->skin;
        }
 
@@ -404,6 +412,7 @@ class RequestContext implements IContextSource {
         */
        public function msg() {
                $args = func_get_args();
+
                return call_user_func_array( 'wfMessage', $args )->setContext( $this );
        }
 
@@ -419,6 +428,7 @@ class RequestContext implements IContextSource {
                if ( $instance === null ) {
                        $instance = new self;
                }
+
                return $instance;
        }
 
@@ -473,7 +483,7 @@ class RequestContext implements IContextSource {
                        $user = User::newFromName( $params['ip'], false );
                }
 
-               $importSessionFunction = function( User $user, array $params ) {
+               $importSessionFunction = function ( User $user, array $params ) {
                        global $wgRequest, $wgUser;
 
                        $context = RequestContext::getMain();
@@ -509,7 +519,7 @@ class RequestContext implements IContextSource {
                $importSessionFunction( $user, $params );
 
                // Set callback to save and close the new session and reload the old one
-               return new ScopedCallback( function() use ( $importSessionFunction, $oUser, $oParams ) {
+               return new ScopedCallback( function () use ( $importSessionFunction, $oUser, $oParams ) {
                        $importSessionFunction( $oUser, $oParams );
                } );
        }
@@ -537,6 +547,7 @@ class RequestContext implements IContextSource {
                        $context->setRequest( new FauxRequest( $request ) );
                }
                $context->user = User::newFromName( '127.0.0.1', false );
+
                return $context;
        }
 }