Merge "Update weblinks in comments from HTTP to HTTPS"
[lhc/web/wiklou.git] / includes / libs / virtualrest / ParsoidVirtualRESTService.php
index 5be4aea..a148a39 100644 (file)
@@ -53,14 +53,14 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
                        unset( $params['URL'] );
                }
                // set up defaults and merge them with the given params
-               $mparams = array_merge( array(
+               $mparams = array_merge( [
                        'name' => 'parsoid',
                        'url' => 'http://localhost:8000/',
                        'prefix' => 'localhost',
                        'domain' => 'localhost',
                        'forwardCookies' => false,
                        'HTTPProxy' => null,
-               ), $params );
+               ], $params );
                // Ensure that the url parameter has a trailing slash.
                $mparams['url'] = preg_replace(
                        '#/?$#',
@@ -79,7 +79,7 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
        }
 
        public function onRequests( array $reqs, Closure $idGeneratorFunc ) {
-               $result = array();
+               $result = [];
                foreach ( $reqs as $key => $req ) {
                        $parts = explode( '/', $req['url'] );
 
@@ -103,7 +103,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
                                continue;
                        }
                        if ( $targetWiki !== 'local' ) {
-
                                throw new Exception( "Only 'local' target wiki is currently supported" );
                        }
                        if ( $reqType !== 'page' && $reqType !== 'transform' ) {
@@ -150,7 +149,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
         * API.  We now translate these to the "real" Parsoid v3 API.
         */
        public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
-
                $parts = explode( '/', $req['url'] );
                list(
                        $targetWiki, // 'local'
@@ -221,7 +219,6 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
                }
 
                return $req;
-
        }
 
 }