| Total Complexity | 6 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ScheduledFlushDiscoverer implements FlushDiscoverer |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Active kernel |
||
| 15 | * |
||
| 16 | * @var Kernel |
||
| 17 | */ |
||
| 18 | protected $kernel; |
||
| 19 | |||
| 20 | public function __construct(Kernel $kernel) |
||
| 21 | { |
||
| 22 | $this->kernel = $kernel; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Returns the flag whether the manifest flush |
||
| 27 | * has been scheduled in previous requests |
||
| 28 | * |
||
| 29 | * @return bool unix timestamp |
||
| 30 | */ |
||
| 31 | protected function getFlush() |
||
| 32 | { |
||
| 33 | $classLoader = $this->kernel->getClassLoader(); |
||
| 34 | $classManifest = $classLoader->getManifest(); |
||
| 35 | |||
| 36 | return (bool) $classManifest->isFlushScheduled(); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @internal This method is not a part of public API and will be deleted without a deprecation warning |
||
| 41 | * |
||
| 42 | * This method is here so that scheduleFlush functionality implementation is kept close to the check |
||
| 43 | * implementation. |
||
| 44 | */ |
||
| 45 | public static function scheduleFlush(Kernel $kernel) |
||
| 56 | } |
||
| 57 | |||
| 58 | public function shouldFlush() |
||
| 65 | } |
||
| 66 | } |
||
| 67 |