| Total Complexity | 12 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 9 | class PrimitiveArray implements TypeUtilInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $fieldName; |
||
| 15 | |||
| 16 | public function __construct(string $fieldName) |
||
| 17 | { |
||
| 18 | $this->fieldName = $fieldName; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function fromNative($input) |
||
| 22 | { |
||
| 23 | if ($input instanceof ValueObjectInterface) { |
||
| 24 | return $this->fromNative($input->toNative()); |
||
| 25 | } |
||
| 26 | $res = []; |
||
| 27 | assert(is_iterable($input)); |
||
| 28 | foreach ($input as $key => $value) { |
||
| 29 | assert(TypeUtils::fromObjectToTypeUtilInterface($key, $value)); |
||
| 30 | $res[$key] = $value; |
||
| 31 | } |
||
| 32 | return $res; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function toNative($input) |
||
| 36 | { |
||
| 37 | if ($input instanceof ValueObjectInterface) { |
||
| 38 | return $this->toNative($input->toNative()); |
||
| 39 | } |
||
| 40 | return (array) $input; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function fromMissingValue() |
||
| 44 | { |
||
| 45 | throw new MissingValueException($this->fieldName); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function supports($input): bool |
||
| 49 | { |
||
| 50 | if ($input instanceof ValueObjectInterface) { |
||
| 51 | return $this->supports($input->toNative()); |
||
| 52 | } |
||
| 53 | return is_iterable($input); |
||
| 54 | } |
||
| 55 | |||
| 56 | public function supportsToNative($input): bool |
||
| 57 | { |
||
| 58 | return is_array($input); |
||
| 59 | } |
||
| 60 | |||
| 61 | public function supportsFromNative($input): bool |
||
| 62 | { |
||
| 63 | return $this->supportsToNative($input); |
||
| 64 | } |
||
| 65 | |||
| 66 | public function __toString() |
||
| 69 | } |
||
| 70 | } |
||
| 71 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths