Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixups noticed by my IDE #96

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function curl_multi_loop_scheduler($mh, callable $done)
break;

default:
throw Exception('Curl error: '.curl_multi_strerror($mrc));
throw new Exception('Curl error: '.curl_multi_strerror($mrc));
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Loop/Loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ protected function runTimers()
* If $timeout is 0, it will return immediately. If $timeout is null, it
* will wait indefinitely.
*
* @param float|null timeout
* @param float|null $timeout
*/
protected function runStreams($timeout)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ public function wait()
* This method makes sure that the result of these callbacks are handled
* correctly, and any chained promises are also correctly fulfilled or
* rejected.
*
* @param callable $callBack
*/
private function invokeCallback(Promise $subPromise, callable $callBack = null)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/coroutine.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
*
* });
*
* @return \Sabre\Event\Promise
*
* @psalm-template TReturn
* @psalm-param callable():\Generator<mixed, mixed, mixed, TReturn> $gen
* @psalm-return Promise<TReturn>
Expand Down
10 changes: 5 additions & 5 deletions tests/Event/CoroutineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testRejectedPromise()
// This line is unreachable, but it's our control
$start += 4;
} catch (\Exception $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

Expand All @@ -78,7 +78,7 @@ public function testRejectedPromiseException()
// This line is unreachable, but it's our control
$start += 4;
} catch (\LogicException $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

Expand Down Expand Up @@ -115,13 +115,13 @@ public function testRejectedPromiseAsync()
// This line is unreachable, but it's our control
$start += 4;
} catch (\Exception $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

$this->assertEquals(1, $start);

$promise->reject(new \Exception((string) 2));
$promise->reject(new \Exception('2'));
Loop\run();

$this->assertEquals(3, $start);
Expand Down Expand Up @@ -156,7 +156,7 @@ public function testDeepException()

$this->assertEquals(1, $start);

$promise->reject(new \Exception((string) 2));
$promise->reject(new \Exception('2'));
Loop\run();

$this->assertEquals(3, $start);
Expand Down