Conditions | 4 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 5 |
Ratio | 25 % |
Changes | 0 |
1 | <?php |
||
36 | public static function fromFile(string $file): self |
||
37 | { |
||
38 | if (!is_readable($file)) { |
||
39 | throw new UnableToLoadFileException('Cannot read file '.$file); |
||
40 | } |
||
41 | |||
42 | $yaml = Yaml::parse(file_get_contents($file)); |
||
43 | |||
44 | $compulsoryFields = ['name', 'parent', 'assignations']; |
||
45 | |||
46 | View Code Duplication | foreach ($compulsoryFields as $field) { |
|
47 | if (!isset($yaml[$field])) { |
||
48 | throw new UnableToLoadFileException('Missing field "'.$field.'" in YAML file '.$file); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | return new self( |
||
53 | $yaml['name'], |
||
54 | $yaml['parent'], |
||
55 | $yaml['assignations'] |
||
56 | ); |
||
83 |
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