| Conditions | 3 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 52 | public function end(callable $callback = null, ?float $beta = null): void |
||
| 53 | { |
||
| 54 | if (null === $this->cache) { |
||
| 55 | throw new InvalidArgumentException('Output cache has already been saved.'); |
||
| 56 | } |
||
| 57 | |||
| 58 | $this->cache->save( |
||
| 59 | $this->key, |
||
| 60 | static function (CacheItemInterface $item) use ($callback) { |
||
| 61 | if (null !== $callback) { |
||
| 62 | $callback($item); |
||
| 63 | } |
||
| 64 | |||
| 65 | return \ob_get_flush(); |
||
| 66 | }, |
||
| 67 | $beta |
||
| 68 | ); |
||
| 69 | |||
| 70 | $this->cache = null; |
||
| 71 | } |
||
| 73 |