Skip to content

Commit

Permalink
Remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Dec 5, 2017
1 parent f2579bd commit 98cfaa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function first(array $promises): Promise {
}

$exceptions[$key] = null; // add entry to array to preserve order
$promise->onResolve(function ($error, $value) use (&$deferred, &$exceptions, &$pending, &$resolved, $key) {
$promise->onResolve(function ($error, $value) use (&$deferred, &$exceptions, &$pending, $key) {
if ($pending === 0) {
return;
}
Expand Down
18 changes: 9 additions & 9 deletions test/Loop/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public function testLoopRunsCanBeConsecutiveAndNested() {
});
$loop->defer(function () use ($loop) {
echo 2;
$loop->defer(function () use ($loop) {
$loop->defer(function () {
echo 4;
});
});
$loop->defer(function () use ($loop) {
$loop->defer(function () {
echo 3;
});
});
Expand Down Expand Up @@ -592,10 +592,10 @@ public function testNoMemoryLeak($type, $args) {
*/
public function testExecutionOrderGuarantees() {
$this->expectOutputString("01 02 03 04 " . \str_repeat("05 ", 8) . "10 11 12 " . \str_repeat("13 ", 4) . "20 " . \str_repeat("21 ", 4) . "30 40 41 ");
$this->start(function (Driver $loop) use (&$ticks) {
$this->start(function (Driver $loop) {
// Wrap in extra defer, so driver creation time doesn't count for timers, as timers are driver creation
// relative instead of last tick relative before first tick.
$loop->defer(function () use ($loop, &$ticks) {
$loop->defer(function () use ($loop) {
$f = function () use ($loop) {
$args = \func_get_args();
return function ($watcherId) use ($loop, &$args) {
Expand Down Expand Up @@ -664,7 +664,7 @@ public function testExecutionOrderGuarantees() {
$loop->disable($def1);
$loop->cancel($def3);
$loop->enable($def1);
$loop->defer(function () use ($loop, $def2, $del4, $del5, $f) {
$loop->defer(function () use ($loop, $def2, $del5, $f) {
$tick = $f(0, 4);
$tick("invalid");
$loop->defer($f(1, 0));
Expand Down Expand Up @@ -1214,10 +1214,10 @@ public function testOptionalCallbackDataPassedOnInvocation() {
$callbackData = new \StdClass;

$this->start(function (Driver $loop) use ($callbackData) {
$loop->defer(function ($watcherId, $callbackData) use ($loop) {
$loop->defer(function ($watcherId, $callbackData) {
$callbackData->defer = true;
}, $callbackData);
$loop->delay($msDelay = 1, function ($watcherId, $callbackData) use ($loop) {
$loop->delay($msDelay = 1, function ($watcherId, $callbackData) {
$callbackData->delay = true;
}, $callbackData);
$loop->repeat($msDelay = 1, function ($watcherId, $callbackData) use ($loop) {
Expand Down Expand Up @@ -1399,15 +1399,15 @@ public function testMultipleWatchersOnSameDescriptor() {
$invoked += 1;
$this->loop->disable($watcher);
});
$watcher2 = $this->loop->onReadable($sockets[0], function ($watcher) use (&$invoked, $watcher1) {
$watcher2 = $this->loop->onReadable($sockets[0], function ($watcher) use (&$invoked) {
$invoked += 10;
$this->loop->disable($watcher);
});
$watcher3 = $this->loop->onWritable($sockets[0], function ($watcher) use (&$invoked) {
$invoked += 100;
$this->loop->disable($watcher);
});
$watcher4 = $this->loop->onWritable($sockets[0], function ($watcher) use (&$invoked, $watcher3) {
$watcher4 = $this->loop->onWritable($sockets[0], function ($watcher) use (&$invoked) {
$invoked += 1000;
$this->loop->disable($watcher);
});
Expand Down

0 comments on commit 98cfaa6

Please sign in to comment.