Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.054 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
61 | 768 | private function createCache(): void |
|
62 | { |
||
63 | 768 | $rules = include 'VersionRules.php'; |
|
64 | |||
65 | 768 | $major = 1; |
|
66 | 768 | $minor = 0; |
|
67 | |||
68 | do { |
||
69 | 768 | $version = constant("\VGirol\JsonApiStructure\VERSION_{$major}_{$minor}"); |
|
70 | 768 | if (!\array_key_exists($version, $rules)) { |
|
71 | $minor = 0; |
||
72 | $major++; |
||
73 | } |
||
74 | |||
75 | 768 | $this->cache = \array_merge_recursive($this->cache, $rules[$version]); |
|
76 | 768 | $minor++; |
|
77 | 768 | } while ($version != $this->version); |
|
78 | 768 | } |
|
80 |