X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiAuthManagerHelper.php;h=2f66277ec40eb4ef18591e7fecb7f6811742b303;hb=54626e5ce172ea469942b01e0ea73f34fb5de07a;hp=3a9fb738b07d767b2855e3d5b5ae6df0c941cc83;hpb=1a81ba9bcb801de0be82fbd44332dada53800879;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiAuthManagerHelper.php b/includes/api/ApiAuthManagerHelper.php index 3a9fb738b0..2f66277ec4 100644 --- a/includes/api/ApiAuthManagerHelper.php +++ b/includes/api/ApiAuthManagerHelper.php @@ -48,7 +48,7 @@ class ApiAuthManagerHelper { $this->module = $module; $params = $module->extractRequestParams(); - $this->messageFormat = isset( $params['messageformat'] ) ? $params['messageformat'] : 'wikitext'; + $this->messageFormat = $params['messageformat'] ?? 'wikitext'; } /** @@ -229,8 +229,8 @@ class ApiAuthManagerHelper { /** * Logs successful or failed authentication. - * @param string|AuthenticationResponse $result Response or error message * @param string $event Event type (e.g. 'accountcreation') + * @param string|AuthenticationResponse $result Response or error message */ public function logAuthenticationResult( $event, $result ) { if ( is_string( $result ) ) { @@ -345,10 +345,10 @@ class ApiAuthManagerHelper { /** * Fetch the standard parameters this helper recognizes * @param string $action AuthManager action - * @param string $param... Parameters to use + * @param string ...$wantedParams Parameters to use * @return array */ - public static function getStandardParams( $action, $param /* ... */ ) { + public static function getStandardParams( $action, ...$wantedParams ) { $params = [ 'requests' => [ ApiBase::PARAM_TYPE => 'string', @@ -384,8 +384,6 @@ class ApiAuthManagerHelper { ]; $ret = []; - $wantedParams = func_get_args(); - array_shift( $wantedParams ); foreach ( $wantedParams as $name ) { if ( isset( $params[$name] ) ) { $ret[$name] = $params[$name];