@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_A_STRING]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_string($data)) { |
|
| 36 | + if (!is_string($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_A_FLOAT]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_float($data)) { |
|
| 36 | + if (!is_float($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $this->pattern = $pattern; |
| 29 | 29 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 30 | - $errorFormatter : |
|
| 31 | - function (string $key, $data) { |
|
| 30 | + $errorFormatter : function(string $key, $data) { |
|
| 32 | 31 | return [self::MATCH_FAILED]; |
| 33 | 32 | }; |
| 34 | 33 | } |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_AN_ARRAY]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_array($data)) { |
|
| 36 | + if (!is_array($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | public function __construct(?callable $errorFormatter = null) |
| 21 | 21 | { |
| 22 | 22 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 23 | - $errorFormatter : |
|
| 24 | - function ($data) { |
|
| 23 | + $errorFormatter : function($data) { |
|
| 25 | 24 | return [self::NOT_A_CALLABLE]; |
| 26 | 25 | }; |
| 27 | 26 | } |
@@ -33,7 +32,7 @@ discard block |
||
| 33 | 32 | |
| 34 | 33 | public function validate($data, array $context = []): ValidationResult |
| 35 | 34 | { |
| 36 | - if (! is_callable($data)) { |
|
| 35 | + if (!is_callable($data)) { |
|
| 37 | 36 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 38 | 37 | } |
| 39 | 38 | |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_A_RESOURCE]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_resource($data)) { |
|
| 36 | + if (!is_resource($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |
@@ -20,8 +20,7 @@ |
||
| 20 | 20 | public function __construct(?callable $errorFormatter = null) |
| 21 | 21 | { |
| 22 | 22 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 23 | - $errorFormatter : |
|
| 24 | - function ($data) { |
|
| 23 | + $errorFormatter : function($data) { |
|
| 25 | 24 | return [self::NOT_NULL]; |
| 26 | 25 | }; |
| 27 | 26 | } |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_AN_INTEGER]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_int($data)) { |
|
| 36 | + if (!is_int($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(?callable $errorFormatter = null) |
| 22 | 22 | { |
| 23 | 23 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 24 | - $errorFormatter : |
|
| 25 | - function ($data) { |
|
| 24 | + $errorFormatter : function($data) { |
|
| 26 | 25 | return [self::NOT_A_BOOL]; |
| 27 | 26 | }; |
| 28 | 27 | } |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | |
| 35 | 34 | public function validate($data, array $context = []): ValidationResult |
| 36 | 35 | { |
| 37 | - if (! is_bool($data)) { |
|
| 36 | + if (!is_bool($data)) { |
|
| 38 | 37 | return ValidationResult::errors(($this->errorFormatter)($data)); |
| 39 | 38 | } |
| 40 | 39 | |