global $wgAuth;
if ( $wgAuth && !$wgAuth instanceof AuthManagerAuthPlugin ) {
- return call_user_func_array( [ $wgAuth, $method ], $params );
+ return $wgAuth->$method( ...$params );
} else {
return $return;
}
$status = self::SEC_FAIL;
}
- $this->logger->info( __METHOD__ . ": $operation is $status" );
+ $this->logger->info( __METHOD__ . ": $operation is $status for '{user}'",
+ [
+ 'user' => $session->getUser()->getName(),
+ 'clientip' => $this->getRequest()->getIP(),
+ ]
+ );
return $status;
}
if ( $permErrors ) {
$status = Status::newGood();
foreach ( $permErrors as $args ) {
- call_user_func_array( [ $status, 'fatal' ], $args );
+ $status->fatal( ...$args );
}
return $status;
}
}
// Checks passed, create the user...
- $from = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : 'CLI';
+ $from = $_SERVER['REQUEST_URI'] ?? 'CLI';
$this->logger->info( __METHOD__ . ': creating new user ({username}) - from: {from}', [
'username' => $username,
'from' => $from,
$spec = [ 'sort2' => $i++ ] + $spec + [ 'sort' => 0 ];
}
unset( $spec );
+ // Sort according to the 'sort' field, and if they are equal, according to 'sort2'
usort( $specs, function ( $a, $b ) {
- return ( (int)$a['sort'] ) - ( (int)$b['sort'] )
- ?: $a['sort2'] - $b['sort2'];
+ return $a['sort'] <=> $b['sort']
+ ?: $a['sort2'] <=> $b['sort2'];
} );
$ret = [];
$providers += $this->getSecondaryAuthenticationProviders();
}
foreach ( $providers as $provider ) {
- call_user_func_array( [ $provider, $method ], $args );
+ $provider->$method( ...$args );
}
}