Skip to content

Commit

Permalink
Check array index instead of error suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Aug 18, 2015
1 parent 57c5cb6 commit f170ace
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/NativeReactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function once(callable $callback, $msDelay, array $options = []) {
$watcher->id = $watcherId = \spl_object_hash($watcher);
$watcher->type = Watcher::TIMER_ONCE;
$watcher->callback = $callback;
$watcher->cbData = @$options["cb_data"];
$watcher->cbData = isset($options["cb_data"]) ? $options["cb_data"] : null;
$watcher->isEnabled = isset($options["enable"]) ? (bool) $options["enable"] : true;
$watcher->keepAlive = isset($options["keep_alive"]) ? (bool) $options["keep_alive"] : true;
$watcher->msDelay = round(($msDelay / 1000), 3);
Expand Down Expand Up @@ -379,7 +379,7 @@ public function repeat(callable $callback, $msInterval, array $options = []) {
$watcher->id = $watcherId = \spl_object_hash($watcher);
$watcher->type = Watcher::TIMER_REPEAT;
$watcher->callback = $callback;
$watcher->cbData = @$options["cb_data"];
$watcher->cbData = isset($options["cb_data"]) ? $options["cb_data"] : null;
$watcher->isEnabled = isset($options["enable"]) ? (bool) $options["enable"] : true;
$watcher->keepAlive = isset($options["keep_alive"]) ? (bool) $options["keep_alive"] : true;
$watcher->msInterval = round(($msInterval / 1000), 3);
Expand Down Expand Up @@ -424,7 +424,7 @@ private function registerIoWatcher($stream, $callback, $options, $type) {
$watcher->id = $watcherId = \spl_object_hash($watcher);
$watcher->type = $type;
$watcher->callback = $callback;
$watcher->cbData = @$options["cb_data"];
$watcher->cbData = isset($options["cb_data"]) ? $options["cb_data"] : null;
$watcher->isEnabled = isset($options["enable"]) ? (bool) $options["enable"] : true;
$watcher->keepAlive = isset($options["keep_alive"]) ? (bool) $options["keep_alive"] : true;
$watcher->stream = $stream;
Expand Down

0 comments on commit f170ace

Please sign in to comment.