@@ -17,8 +17,7 @@ |
||
17 | 17 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
18 | 18 | 'is_callable', |
19 | 19 | is_callable($errorFormatter) ? |
20 | - $errorFormatter : |
|
21 | - function ($data) { |
|
20 | + $errorFormatter : function($data) { |
|
22 | 21 | return [self::NOT_A_CALLABLE]; |
23 | 22 | } |
24 | 23 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_bool', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_A_BOOL]; |
24 | 23 | } |
25 | 24 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_array', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_AN_ARRAY]; |
24 | 23 | } |
25 | 24 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_int', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_AN_INTEGER]; |
24 | 23 | } |
25 | 24 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_object', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_AN_OBJECT]; |
24 | 23 | } |
25 | 24 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_iterable', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_AN_ITERABLE]; |
24 | 23 | } |
25 | 24 | ); |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_string', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_A_STRING]; |
24 | 23 | } |
25 | 24 | ); |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $this->assertion = $assertion; |
28 | 28 | $this->errorFormatter = is_callable($errorFormatter) ? |
29 | - $errorFormatter : |
|
30 | - function ($data) { |
|
29 | + $errorFormatter : function($data) { |
|
31 | 30 | return [self::NOT_AS_ASSERTED]; |
32 | 31 | }; |
33 | 32 | } |
@@ -44,7 +43,7 @@ discard block |
||
44 | 43 | |
45 | 44 | public function validate($data, array $context = []): ValidationResult |
46 | 45 | { |
47 | - if (! ($this->assertion)($data)) { |
|
46 | + if (!($this->assertion)($data)) { |
|
48 | 47 | return ValidationResult::errors(($this->errorFormatter)($data)); |
49 | 48 | } |
50 | 49 |
@@ -18,8 +18,7 @@ |
||
18 | 18 | $this->isAsAsserted = IsAsAsserted::withAssertionAndErrorFormatter( |
19 | 19 | 'is_resource', |
20 | 20 | is_callable($errorFormatter) ? |
21 | - $errorFormatter : |
|
22 | - function ($data) { |
|
21 | + $errorFormatter : function($data) { |
|
23 | 22 | return [self::NOT_A_RESOURCE]; |
24 | 23 | } |
25 | 24 | ); |