| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 6 | public function __invoke(?string $name = null): ObjectStorageAdapter |
|
| 23 | { |
||
| 24 | 6 | $name ??= $this->defaultAdapter; |
|
| 25 | 6 | $adapters = iterator_to_array($this->adapters); |
|
| 26 | |||
| 27 | 6 | if (!\array_key_exists($name, $adapters)) { |
|
| 28 | 1 | throw new \UnexpectedValueException(sprintf('Invalid adapter name "%s" provided. Available options are: %s', $name, implode(', ', array_keys($adapters)))); |
|
| 29 | } |
||
| 30 | |||
| 31 | 6 | return $adapters[$name]; |
|
| 32 | } |
||
| 34 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..