Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | abstract class ComposingAssertion |
||
11 | { |
||
12 | /** |
||
13 | * @var IsAsAsserted |
||
14 | */ |
||
15 | protected $isAsAsserted; |
||
16 | |||
17 | abstract public function __construct(?callable $errorFormatter = null); |
||
18 | |||
19 | public static function withFormatter(callable $errorFormatter): self |
||
20 | { |
||
21 | return new static($errorFormatter); |
||
22 | } |
||
23 | |||
24 | public function validate($data, array $context = []): ValidationResult |
||
25 | { |
||
26 | return $this->isAsAsserted->validate($data, $context); |
||
27 | } |
||
28 | |||
29 | protected static function withTranslatorAndMessage(Translator $translator, string $message) |
||
33 | }); |
||
34 | } |
||
35 | } |
||
36 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.