| Conditions | 7 |
| Paths | 5 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function get(string $key): ?float |
||
| 27 | { |
||
| 28 | $value = $this->cache->get($key); |
||
| 29 | if (!is_int($value) && !is_float($value) && $value !== false && $value !== null) { |
||
| 30 | throw new InvalidArgumentException('The value is not supported by SimpleCacheStorage, it must be int, float or null.'); |
||
| 31 | } |
||
| 32 | |||
| 33 | $value = ($value === false || $value === null) ? null : (float)$value; |
||
| 34 | return $value; |
||
| 35 | } |
||
| 37 |