Skip to content

Commit

Permalink
Use mbfisher/watch 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfisher committed May 13, 2014
1 parent 4dbca6b commit 590d2f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/WatchPlugin.php
Expand Up @@ -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);
}
}
}
4 changes: 2 additions & 2 deletions tests/src/WatchPluginTest.php
Expand Up @@ -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);
}
}

0 comments on commit 590d2f7

Please sign in to comment.