| 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 |
||
| 102 | 777 | private function createCache(): void |
|
| 103 | { |
||
| 104 | 777 | $rules = $this->getRulesFileContent(); |
|
| 105 | |||
| 106 | 777 | $major = 1; |
|
| 107 | 777 | $minor = 0; |
|
| 108 | |||
| 109 | do { |
||
| 110 | 777 | $version = constant("\\VGirol\\JsonApiConstant\\Versions::VERSION_{$major}_{$minor}"); |
|
| 111 | 777 | if (!\array_key_exists($version, $rules)) { |
|
| 112 | $minor = 0; |
||
| 113 | $major++; |
||
| 114 | } |
||
| 115 | |||
| 116 | 777 | $this->cache = \array_merge_recursive($this->cache, $rules[$version]); |
|
| 117 | 777 | $minor++; |
|
| 118 | 777 | } while ($version != $this->version); |
|
| 119 | 777 | } |
|
| 121 |