/** @var mixed */
public $value;
/** @var array Map of (key => bool) to indicate success of each part of batch operations */
- public $success = array();
+ public $success = [];
/** @var int Counter for batch operations */
public $successCount = 0;
/** @var int Counter for batch operations */
*/
public static function newFatal( $message /*, parameters...*/ ) {
return new self( call_user_func_array(
- array( 'StatusValue', 'newFatal' ), func_get_args()
+ [ 'StatusValue', 'newFatal' ], func_get_args()
) );
}
* @param string|Message $message Message name or object
*/
public function warning( $message /*, parameters... */ ) {
- call_user_func_array( array( $this->sv, 'warning' ), func_get_args() );
+ call_user_func_array( [ $this->sv, 'warning' ], func_get_args() );
}
/**
* @param string|Message $message Message name or object
*/
public function error( $message /*, parameters... */ ) {
- call_user_func_array( array( $this->sv, 'error' ), func_get_args() );
+ call_user_func_array( [ $this->sv, 'error' ], func_get_args() );
}
/**
* @param string|Message $message Message name or object
*/
public function fatal( $message /*, parameters... */ ) {
- call_user_func_array( array( $this->sv, 'fatal' ), func_get_args() );
+ call_user_func_array( [ $this->sv, 'fatal' ], func_get_args() );
}
/**
if ( !$this->cleanCallback ) {
return $params;
}
- $cleanParams = array();
+ $cleanParams = [];
foreach ( $params as $i => $param ) {
$cleanParams[$i] = call_user_func( $this->cleanCallback, $param );
}
* @return Message[]
*/
protected function getErrorMessageArray( $errors ) {
- return array_map( array( $this, 'getErrorMessage' ), $errors );
+ return array_map( [ $this, 'getErrorMessage' ], $errors );
}
/**
*
* @note: this handles RawMessage poorly
*
- * @param string $type
+ * @param string|bool $type
* @return array
*/
protected function getStatusArray( $type = false ) {
- $result = array();
+ $result = [];
foreach ( $this->sv->getErrors() as $error ) {
if ( $type === false || $error['type'] === $type ) {
if ( $error['message'] instanceof MessageSpecifier ) {
$result[] = array_merge(
- array( $error['message']->getKey() ),
+ [ $error['message']->getKey() ],
$error['message']->getParams()
);
} elseif ( $error['params'] ) {
- $result[] = array_merge( array( $error['message'] ), $error['params'] );
+ $result[] = array_merge( [ $error['message'] ], $error['params'] );
} else {
- $result[] = array( $error['message'] );
+ $result[] = [ $error['message'] ];
}
}
}
*/
function __sleep() {
$keys = array_keys( get_object_vars( $this ) );
- return array_diff( $keys, array( 'cleanCallback' ) );
+ return array_diff( $keys, [ 'cleanCallback' ] );
}
/**