| Conditions | 3 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function startWatching() |
||
| 43 | { |
||
| 44 | $this->terminal->displayScreen(new Phpunit($this->phpunitArguments), false); |
||
| 45 | |||
| 46 | $watcher = new ResourceWatcher(new ResourceCacheMemory()); |
||
| 47 | |||
| 48 | $watcher->setFinder($this->finder); |
||
| 49 | |||
| 50 | $this->loop->addPeriodicTimer(1 / 4, function () use ($watcher) { |
||
| 51 | if (! $this->terminal->isDisplayingScreen(Phpunit::class)) { |
||
| 52 | return; |
||
| 53 | } |
||
| 54 | |||
| 55 | $watcher->findChanges(); |
||
| 56 | |||
| 57 | if ($watcher->hasChanges()) { |
||
| 58 | $this->terminal->refreshScreen(); |
||
| 59 | } |
||
| 60 | }); |
||
| 61 | |||
| 62 | $this->loop->run(); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |