dont call notify callback if we dont have a proper change

This commit is contained in:
Robin Appelman 2017-04-24 15:30:06 +02:00
commit 4ca899f582
2 changed files with 42 additions and 3 deletions

View file

@ -59,7 +59,10 @@ class NotifyHandler implements INotifyHandler {
public function listen($callback) {
if ($this->listening) {
$this->connection->read(function ($line) use ($callback) {
return $callback($this->parseChangeLine($line));
$change = $this->parseChangeLine($line);
if ($change) {
return $callback($change);
}
});
}
}