<?php
/**
- * Copyright © 2016 Brad Jorsch <bjorsch@wikimedia.org>
+ * Copyright © 2016 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
$this->module = $module;
$params = $module->extractRequestParams();
- $this->messageFormat = isset( $params['messageformat'] ) ? $params['messageformat'] : 'wikitext';
+ $this->messageFormat = $params['messageformat'] ?? 'wikitext';
}
/**
/**
* 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 ) ) {
/**
* 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',
];
$ret = [];
- $wantedParams = func_get_args();
- array_shift( $wantedParams );
foreach ( $wantedParams as $name ) {
if ( isset( $params[$name] ) ) {
$ret[$name] = $params[$name];