Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ContainsOnlyAllowedMembers extends Constraint |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $members; |
||
15 | |||
16 | /** |
||
17 | * Class constructor. |
||
18 | * |
||
19 | * @param array $members |
||
20 | */ |
||
21 | 381 | public function __construct(array $members) |
|
24 | 381 | } |
|
25 | |||
26 | /** |
||
27 | * Returns a string representation of the constraint. |
||
28 | */ |
||
29 | 66 | public function default(): string |
|
30 | { |
||
31 | 66 | return Messages::ONLY_ALLOWED_MEMBERS; |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * Evaluates the constraint for parameter $json. Returns true if the constraint is met, false otherwise. |
||
36 | * |
||
37 | * @param mixed $json Value or object to evaluate |
||
38 | * |
||
39 | * @return boolean |
||
40 | */ |
||
41 | 381 | protected function handle($json): bool |
|
54 | } |
||
55 | } |
||
56 |