diff --git a/src/WatchPlugin.php b/src/WatchPlugin.php index 61a666c..d3bf2a1 100644 --- a/src/WatchPlugin.php +++ b/src/WatchPlugin.php @@ -2,17 +2,17 @@ namespace Task\Plugin; -use mbfisher\Watch\InotifyWatcher; -use mbfisher\Watch\IteratorWatcher; +use mbfisher\Watch\Watcher\InotifyWatcher; +use mbfisher\Watch\Watcher\IteratorWatcher; class WatchPlugin implements PluginInterface { - public function init($path, $pattern = null) + public function init($path, $include = null, $exclude = null) { if (function_exists('inotify_init')) { - return new InotifyWatcher($path, $pattern); + return new InotifyWatcher($path, $include, $exclude); } else { - return new IteratorWatcher($path, $pattern); + return new IteratorWatcher($path, $include, $exclude); } } } diff --git a/tests/src/WatchPluginTest.php b/tests/src/WatchPluginTest.php index 5bafc46..9b8ed99 100644 --- a/tests/src/WatchPluginTest.php +++ b/tests/src/WatchPluginTest.php @@ -16,13 +16,13 @@ public function setUp() public function testInitIteratorWatcher() { $watcher = (new WatchPlugin)->init($this->tmp); - $this->assertInstanceOf('mbfisher\Watch\IteratorWatcher', $watcher); + $this->assertInstanceOf('mbfisher\Watch\Watcher\IteratorWatcher', $watcher); } public function testInitInotifyWatcher() { runkit_function_add('inotify_init', '', 'return true;'); $watcher = (new WatchPlugin)->init($this->tmp); - $this->assertInstanceOf('mbfisher\Watch\InotifyWatcher', $watcher); + $this->assertInstanceOf('mbfisher\Watch\Watcher\InotifyWatcher', $watcher); } }