X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FAuthManagerSpecialPage.php;h=1476e85eb8afdfe4cda89f8e4c33d1b74a3b11d5;hb=89c7f8387575ac7595fdb0b0b25b07a547648c2f;hp=b9745de1c62ca456bc2092fb2996396f621c4c6d;hpb=16c80e429be5904fb42a93f260f8de3d18f0c692;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index b9745de1c6..1476e85eb8 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -70,7 +70,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { * Used to preserve POST data over a HTTP redirect. * * @param array $data - * @param bool $wasPosted + * @param bool|null $wasPosted */ protected function setRequest( array $data, $wasPosted = null ) { $request = $this->getContext()->getRequest(); @@ -223,7 +223,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { * Load or initialize $authAction, $authRequests and $subPage. * Subclasses should call this from execute() or otherwise ensure the variables are initialized. * @param string $subPage Subpage of the special page. - * @param string $authAction Override auth action specified in request (this is useful + * @param string|null $authAction Override auth action specified in request (this is useful * when the form needs to be changed from to _CONTINUE after a successful * authentication step) * @param bool $reset Regenerate the requests even if a cached version is available @@ -432,11 +432,11 @@ abstract class AuthManagerSpecialPage extends SpecialPage { $status = Status::newFatal( new RawMessage( '$1', $status ) ); } elseif ( is_array( $status ) ) { if ( is_string( reset( $status ) ) ) { - $status = call_user_func_array( 'Status::newFatal', $status ); + $status = Status::newFatal( ...$status ); } elseif ( is_array( reset( $status ) ) ) { $status = Status::newGood(); foreach ( $status as $message ) { - call_user_func_array( [ $status, 'fatal' ], $message ); + $status->fatal( ...$message ); } } else { throw new UnexpectedValueException( 'invalid HTMLForm::trySubmit() return value: ' @@ -718,8 +718,8 @@ abstract class AuthManagerSpecialPage extends SpecialPage { $field['__index'] = $i++; } uasort( $formDescriptor, function ( $first, $second ) { - return self::getField( $first, 'weight', 0 ) - self::getField( $second, 'weight', 0 ) - ?: $first['__index'] - $second['__index']; + return self::getField( $first, 'weight', 0 ) <=> self::getField( $second, 'weight', 0 ) + ?: $first['__index'] <=> $second['__index']; } ); foreach ( $formDescriptor as &$field ) { unset( $field['__index'] ); @@ -730,7 +730,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { * Get an array value, or a default if it does not exist. * @param array $array * @param string $fieldName - * @param mixed $default + * @param mixed|null $default * @return mixed */ protected static function getField( array $array, $fieldName, $default = null ) {