| Total Complexity | 16 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 9 | class StringLiteral 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 | return $this->toNative($input); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function fromMissingValue() |
||
| 27 | { |
||
| 28 | throw new MissingValueException($this->fieldName); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function toNative($input) |
||
| 32 | { |
||
| 33 | if ($input instanceof ValueObjectInterface) { |
||
| 34 | return $this->toNative($input->toNative()); |
||
| 35 | } |
||
| 36 | return is_array($input) ? 'array' : (string) $input; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function supports($input): bool |
||
| 40 | { |
||
| 41 | if ($input instanceof ValueObjectInterface && $this->supports($input->toNative())) { |
||
| 42 | return true; |
||
| 43 | } |
||
| 44 | switch (gettype($input)) { |
||
| 45 | case 'boolean': |
||
| 46 | case 'integer': |
||
| 47 | case 'double': |
||
| 48 | case 'string': |
||
| 49 | return true; |
||
| 50 | } |
||
| 51 | return false; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function supportsToNative($input): bool |
||
| 57 | } |
||
| 58 | |||
| 59 | public function supportsFromNative($input): bool |
||
| 60 | { |
||
| 61 | return $this->supportsToNative($input); |
||
| 62 | } |
||
| 63 | |||
| 64 | public function __toString() |
||
| 67 | } |
||
| 68 | } |
||
| 69 |
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