Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #68 from LubeyAG/master
Browse files Browse the repository at this point in the history
Support for Laravel 7
  • Loading branch information
mpociot authored May 29, 2020
2 parents 7152352 + 6746892 commit 10f2f04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"cboden/ratchet": "^0.4.1",
"clue/buzz-react": "^2.5",
"guzzlehttp/guzzle": "^6.3",
"illuminate/console": "5.6.*|5.7.*|5.8.*|6.*",
"illuminate/support": "5.6.*|5.7.*|5.8.*|6.*",
"illuminate/console": "5.6.*|5.7.*|5.8.*|6.*|7.*",
"illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*",
"laravel/dusk": "^4.0|^5.0|^6.0",
"yosymfony/resource-watcher": "^1.2"
"yosymfony/resource-watcher": "^2.0"
},
"require-dev": {
"larapack/dd": "^1.0",
Expand Down
10 changes: 5 additions & 5 deletions src/Watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Closure;
use React\EventLoop\LoopInterface;
use Symfony\Component\Finder\Finder;
use Yosymfony\ResourceWatcher\Crc32ContentHash;
use Yosymfony\ResourceWatcher\ResourceCacheMemory;
use Yosymfony\ResourceWatcher\ResourceWatcher;

Expand All @@ -24,14 +25,13 @@ public function __construct(Finder $finder, LoopInterface $loop)

public function startWatching(Closure $callback)
{
$watcher = new ResourceWatcher(new ResourceCacheMemory());

$watcher->setFinder($this->finder);
$hashContent = new Crc32ContentHash();
$watcher = new ResourceWatcher(new ResourceCacheMemory(), $this->finder, $hashContent);

$this->loop->addPeriodicTimer(1 / 2, function () use ($watcher, $callback) {
$watcher->findChanges();
$watcher_result = $watcher->findChanges();

if ($watcher->hasChanges()) {
if ($watcher_result->hasChanges()) {
call_user_func($callback);
}
});
Expand Down

0 comments on commit 10f2f04

Please sign in to comment.