| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function setCache($cache) : self |
||
| 44 | { |
||
| 45 | if (is_string($cache)) { |
||
| 46 | $this->cache = CacheFactory::make($cache); |
||
| 47 | } elseif ($cache instanceof Cacheable) { |
||
| 48 | $this->cache = $cache; |
||
| 49 | } |
||
| 50 | |||
| 51 | $prefix = 'tus:' . strtolower((new \ReflectionClass(static::class))->getShortName()) . ':'; |
||
| 52 | |||
| 53 | $this->cache->setPrefix($prefix); |
||
| 54 | |||
| 55 | return $this; |
||
| 56 | } |
||
| 92 |