| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function startWatching(Closure $callback) |
||
| 27 | { |
||
| 28 | $hashContent = new Crc32ContentHash(); |
||
| 29 | $watcher = new ResourceWatcher(new ResourceCacheMemory(), $this->finder, $hashContent); |
||
| 30 | |||
| 31 | $this->loop->addPeriodicTimer(1 / 2, function () use ($watcher, $callback) { |
||
| 32 | $watcher_result = $watcher->findChanges(); |
||
| 33 | |||
| 34 | if ($watcher_result->hasChanges()) { |
||
| 35 | call_user_func($callback); |
||
| 36 | } |
||
| 37 | }); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |