X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFauxRequest.php;h=2f7f75b4d7b87d4809d4eb75f648efa6f5988ec1;hb=89539f2aa1b158fdcc703ad053e2580cb97a6385;hp=f049d2ece0d8e769afc6b1969decfb3f2b37cc75;hpb=f56a905990f579a81f15ce636ab03758c15690df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php index f049d2ece0..2f7f75b4d7 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; } @@ -126,12 +126,12 @@ class FauxRequest extends WebRequest { /** * @since 1.26 - * @param string $name Unprefixed name of the cookie to set + * @param string $key Unprefixed name of the cookie to set * @param string|null $value Value of the cookie to set * @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 ); } /** @@ -152,6 +152,7 @@ class FauxRequest extends WebRequest { /** * @since 1.25 + * @param string $url */ public function setRequestURL( $url ) { $this->requestUrl = $url; @@ -160,6 +161,7 @@ class FauxRequest extends WebRequest { /** * @since 1.25 MWException( "getRequestURL not implemented" ) * no longer thrown. + * @return string */ public function getRequestURL() { if ( $this->requestUrl === null ) { @@ -177,7 +179,7 @@ class FauxRequest extends WebRequest { * @param string $val */ public function setHeader( $name, $val ) { - $this->setHeaders( array( $name => $val ) ); + $this->setHeaders( [ $name => $val ] ); } /** @@ -226,14 +228,16 @@ class FauxRequest extends WebRequest { } /** + * @codeCoverageIgnore * @param array $extWhitelist * @return bool */ - public function checkUrlExtension( $extWhitelist = array() ) { + public function checkUrlExtension( $extWhitelist = [] ) { return true; } /** + * @codeCoverageIgnore * @return string */ protected function getRawIP() {