@@ -27,8 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->className = $className; |
| 29 | 29 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 30 | - $errorFormatter : |
|
| 31 | - function (string $className, $data) { |
|
| 30 | + $errorFormatter : function(string $className, $data) { |
|
| 32 | 31 | return [self::NOT_AN_INSTANCE]; |
| 33 | 32 | }; |
| 34 | 33 | } |
@@ -47,7 +46,7 @@ discard block |
||
| 47 | 46 | { |
| 48 | 47 | return new self( |
| 49 | 48 | $className, |
| 50 | - function (string $className, $data) use ($translator) { |
|
| 49 | + function(string $className, $data) use ($translator) { |
|
| 51 | 50 | return [$translator->translate(self::NOT_AN_INSTANCE)]; |
| 52 | 51 | } |
| 53 | 52 | ); |
@@ -55,7 +54,7 @@ discard block |
||
| 55 | 54 | |
| 56 | 55 | public function validate($data, array $context = []): ValidationResult |
| 57 | 56 | { |
| 58 | - if (! $data instanceof $this->className) { |
|
| 57 | + if (!$data instanceof $this->className) { |
|
| 59 | 58 | return ValidationResult::errors(($this->errorFormatter)($this->className, $data)); |
| 60 | 59 | } |
| 61 | 60 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function validate($data, array $context = []): ValidationResult |
| 15 | 15 | { |
| 16 | 16 | return parent::validateAssertion( |
| 17 | - function ($data) { |
|
| 17 | + function($data) { |
|
| 18 | 18 | return null !== $data; |
| 19 | 19 | }, |
| 20 | 20 | $data, |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function validate($data, array $context = []): ValidationResult |
| 15 | 15 | { |
| 16 | 16 | return parent::validateAssertion( |
| 17 | - function ($data) { |
|
| 17 | + function($data) { |
|
| 18 | 18 | return null === $data; |
| 19 | 19 | }, |
| 20 | 20 | $data, |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function validate($data, array $context = []): ValidationResult |
| 15 | 15 | { |
| 16 | 16 | return parent::validateAssertion( |
| 17 | - function ($data) { |
|
| 17 | + function($data) { |
|
| 18 | 18 | return !empty($data); |
| 19 | 19 | }, |
| 20 | 20 | $data, |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public static function withTranslator(Translator $translator): self |
| 31 | 31 | { |
| 32 | - return new static(function ($data) use ($translator) { |
|
| 32 | + return new static(function($data) use ($translator) { |
|
| 33 | 33 | return [$translator->translate(static::MESSAGE)]; |
| 34 | 34 | }); |
| 35 | 35 | } |
@@ -41,8 +41,7 @@ discard block |
||
| 41 | 41 | return IsAsAsserted::withAssertionAndErrorFormatter( |
| 42 | 42 | $assertion, |
| 43 | 43 | is_callable($this->errorFormatter) ? |
| 44 | - $this->errorFormatter : |
|
| 45 | - function ($data) { |
|
| 44 | + $this->errorFormatter : function($data) { |
|
| 46 | 45 | return [static::MESSAGE]; |
| 47 | 46 | } |
| 48 | 47 | )->validate($data, $context); |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $this->key = $key; |
| 28 | 28 | $this->errorFormatter = is_callable($errorFormatter) ? |
| 29 | - $errorFormatter : |
|
| 30 | - function (string $key, $data) { |
|
| 29 | + $errorFormatter : function(string $key, $data) { |
|
| 31 | 30 | return [self::PRESENT_KEY]; |
| 32 | 31 | }; |
| 33 | 32 | } |
@@ -46,7 +45,7 @@ discard block |
||
| 46 | 45 | { |
| 47 | 46 | return new self( |
| 48 | 47 | $key, |
| 49 | - function (string $key, $data) use ($translator) { |
|
| 48 | + function(string $key, $data) use ($translator) { |
|
| 50 | 49 | return [$translator->translate(self::PRESENT_KEY)]; |
| 51 | 50 | } |
| 52 | 51 | ); |