| Total Complexity | 8 |
| Total Lines | 107 |
| Duplicated Lines | 0 % |
| Coverage | 82.61% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class VersionService |
||
| 13 | { |
||
| 14 | use CanUseDotPath; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Undocumented variable |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $default = Versions::VERSION_1_0; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Undocumented variable |
||
| 25 | * |
||
| 26 | 768 | * @var string |
|
| 27 | */ |
||
| 28 | 768 | private $version; |
|
| 29 | 768 | ||
| 30 | /** |
||
| 31 | * Undocumented variable |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | private $cache = []; |
||
| 36 | |||
| 37 | /** |
||
| 38 | 768 | * Create a new instance |
|
| 39 | * |
||
| 40 | 768 | * @param string|null $version The version of the JSON:API specification |
|
| 41 | 768 | * |
|
| 42 | * @return void |
||
| 43 | 768 | */ |
|
| 44 | public function __construct(string $version = null) |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Set the version of the JSON:API specification |
||
| 51 | * |
||
| 52 | * @param string $version |
||
| 53 | * |
||
| 54 | * @return static |
||
| 55 | */ |
||
| 56 | 441 | public function setVersion(string $version) |
|
| 57 | { |
||
| 58 | 441 | $this->version = $version; |
|
| 59 | $this->createCache(); |
||
| 60 | |||
| 61 | 768 | return $this; |
|
| 62 | } |
||
| 63 | 768 | ||
| 64 | /** |
||
| 65 | 768 | * Get the version of the JSON:API specification |
|
| 66 | 768 | * |
|
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | 768 | public function getVersion(): string |
|
| 70 | 768 | { |
|
| 71 | return $this->version; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | 768 | * Undocumented function |
|
| 76 | 768 | * |
|
| 77 | 768 | * @param string $path |
|
| 78 | 768 | * |
|
| 79 | * @return mixed |
||
| 80 | * @throws \VGirol\JsonApiStructure\Exception\DotPathException |
||
| 81 | */ |
||
| 82 | public function getRule(string $path) |
||
| 83 | { |
||
| 84 | return $this->retrieve($path, $this->cache); |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Undocumented function |
||
| 89 | * |
||
| 90 | * @return array |
||
| 91 | */ |
||
| 92 | protected function getRulesFileContent(): array |
||
| 93 | { |
||
| 94 | return include __DIR__ . '/VersionRules.php'; |
||
| 95 | } |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Undocumented function |
||
| 99 | * |
||
| 100 | * @return void |
||
| 101 | */ |
||
| 102 | private function createCache(): void |
||
| 119 | } |
||
| 120 | } |
||
| 121 |
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