X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FFauxRequest.php;h=158c8521fe7a8c0f823ca6f21c7ef8e2dc10674b;hb=29906d505b9b3d5f0fd1e6534f077b7fe2c623dc;hp=f049d2ece0d8e769afc6b1969decfb3f2b37cc75;hpb=343c411f79ee8e3cc1c4de34a347eeb5210eb59c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php index f049d2ece0..158c8521fe 100644 --- a/includes/FauxRequest.php +++ b/includes/FauxRequest.php @@ -33,18 +33,18 @@ use MediaWiki\Session\SessionManager; class FauxRequest extends WebRequest { private $wasPosted = false; private $requestUrl; - protected $cookies = array(); + protected $cookies = []; /** * @param array $data Array of *non*-urlencoded key => value pairs, the * fake GET/POST values * @param bool $wasPosted Whether to treat the data as POST - * @param MediaWiki\\Session\\Session|array|null $session Session, session + * @param MediaWiki\Session\Session|array|null $session Session, session * data array, or null * @param string $protocol 'http' or 'https' * @throws MWException */ - public function __construct( $data = array(), $wasPosted = false, + public function __construct( $data = [], $wasPosted = false, $session = null, $protocol = 'http' ) { $this->requestTime = microtime( true ); @@ -98,7 +98,7 @@ class FauxRequest extends WebRequest { */ public function getQueryValues() { if ( $this->wasPosted ) { - return array(); + return []; } else { return $this->data; } @@ -131,7 +131,7 @@ class FauxRequest extends WebRequest { * @param string|null $prefix Cookie prefix. Defaults to $wgCookiePrefix */ public function setCookie( $key, $value, $prefix = null ) { - $this->setCookies( array( $key => $value ), $prefix ); + $this->setCookies( [ $key => $value ], $prefix ); } /** @@ -177,7 +177,7 @@ class FauxRequest extends WebRequest { * @param string $val */ public function setHeader( $name, $val ) { - $this->setHeaders( array( $name => $val ) ); + $this->setHeaders( [ $name => $val ] ); } /** @@ -229,7 +229,7 @@ class FauxRequest extends WebRequest { * @param array $extWhitelist * @return bool */ - public function checkUrlExtension( $extWhitelist = array() ) { + public function checkUrlExtension( $extWhitelist = [] ) { return true; }