| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final class IsOneOfAssert extends Constraint |
||
| 17 | { |
||
| 18 | public function __construct(private array $allowedValues) |
||
| 19 | { |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Returns a string representation of the object. |
||
| 24 | */ |
||
| 25 | public function toString(): string |
||
| 26 | { |
||
| 27 | $allowedValues = []; |
||
| 28 | |||
| 29 | foreach ($this->allowedValues as $value) { |
||
| 30 | $this->allowedValues[] = VarDumper::create($value)->asString(); |
||
| 31 | } |
||
| 32 | |||
| 33 | $expectedAsString = implode(', ', $allowedValues); |
||
| 34 | |||
| 35 | return "is one of $expectedAsString"; |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function matches($other): bool |
||
| 41 | } |
||
| 42 | } |
||
| 43 |