| Conditions | 2 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 38 | public function getDefinitions() |
||
| 39 | { |
||
| 40 | return [ |
||
| 41 | Cache::class => function () { |
||
| 42 | |||
| 43 | $pools = []; |
||
| 44 | if (count($this->pools) < 1) { |
||
| 45 | $pools[] = new ArrayCachePool; |
||
| 46 | } else { |
||
| 47 | $pools = array_map(function (callable $resolver) { |
||
| 48 | return call_user_func($resolver); |
||
| 49 | }, $this->pools); |
||
| 50 | } |
||
| 51 | |||
| 52 | return new Psr6Cache( |
||
| 53 | new CachePoolChain($pools) |
||
| 54 | ); |
||
| 55 | } |
||
| 56 | ]; |
||
| 57 | } |
||
| 58 | } |
||
| 59 |