Total Complexity | 7 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class HasField extends Constraint |
||
9 | { |
||
10 | private $fieldName; |
||
11 | |||
12 | 8 | public function __construct(string $fieldName) |
|
13 | { |
||
14 | 8 | $this->fieldName = $fieldName; |
|
15 | 8 | } |
|
16 | |||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | 4 | public function toString(): string |
|
21 | { |
||
22 | 4 | return \sprintf('contains field "%s"', $this->fieldName); |
|
23 | } |
||
24 | |||
25 | 8 | public function matches($other): bool |
|
39 | } |
||
40 | } |
||
41 |