| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | final class IsOneOfAssert extends Constraint |
||
| 18 | { |
||
| 19 | private array $allowedValues; |
||
| 20 | |||
| 21 | public function __construct(array $allowedValues) |
||
| 22 | { |
||
| 23 | $this->allowedValues = $allowedValues; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Returns a string representation of the object. |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public function toString(): string |
||
| 32 | { |
||
| 33 | $allowedValues = array_map(static function ($value) { |
||
| 34 | return VarDumper::dumpAsString($value); |
||
|
|
|||
| 35 | }, $this->allowedValues); |
||
| 36 | |||
| 37 | $expectedAsString = implode(', ', $allowedValues); |
||
| 38 | |||
| 39 | return "is one of $expectedAsString"; |
||
| 40 | } |
||
| 41 | |||
| 42 | protected function matches($other): bool |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.