@@ -24,7 +24,7 @@ class BaseConstraint
2424 /**
2525 * @var array Errors
2626 */
27- protected $ errors = array () ;
27+ protected $ errors = [] ;
2828
2929 /**
3030 * @var int All error types which have occurred
@@ -44,11 +44,11 @@ public function __construct(?Factory $factory = null)
4444 $ this ->factory = $ factory ?: new Factory ();
4545 }
4646
47- public function addError (ConstraintError $ constraint , ?JsonPointer $ path = null , array $ more = array () )
47+ public function addError (ConstraintError $ constraint , ?JsonPointer $ path = null , array $ more = [] )
4848 {
4949 $ message = $ constraint ? $ constraint ->getMessage () : '' ;
5050 $ name = $ constraint ? $ constraint ->getValue () : '' ;
51- $ error = array (
51+ $ error = [
5252 'property ' => $ this ->convertJsonPointerIntoPropertyPath ($ path ?: new JsonPointer ('' )),
5353 'pointer ' => ltrim (strval ($ path ?: new JsonPointer ('' )), '# ' ),
5454 'message ' => ucfirst (vsprintf ($ message , array_map (function ($ val ) {
@@ -58,12 +58,12 @@ public function addError(ConstraintError $constraint, ?JsonPointer $path = null,
5858
5959 return json_encode ($ val );
6060 }, array_values ($ more )))),
61- 'constraint ' => array (
61+ 'constraint ' => [
6262 'name ' => $ name ,
6363 'params ' => $ more
64- ) ,
64+ ] ,
6565 'context ' => $ this ->factory ->getErrorContext (),
66- ) ;
66+ ] ;
6767
6868 if ($ this ->factory ->getConfig (Constraint::CHECK_MODE_EXCEPTIONS )) {
6969 throw new ValidationException (sprintf ('Error validating %s: %s ' , $ error ['pointer ' ], $ error ['message ' ]));
@@ -119,7 +119,7 @@ public function isValid()
119119 */
120120 public function reset ()
121121 {
122- $ this ->errors = array () ;
122+ $ this ->errors = [] ;
123123 $ this ->errorMask = Validator::ERROR_NONE ;
124124 }
125125
0 commit comments