Skip to content

Commit

Permalink
Fix line lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Apr 13, 2017
1 parent 5e54530 commit fed09e4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/functions.php
Expand Up @@ -27,8 +27,8 @@ function wrap(callable $callback): callable {

/**
* Returns a new function that wraps $worker in a promise/coroutine-aware function that automatically upgrades
* Generators to coroutines. The returned function always returns a promise when invoked. If $worker throws, a failed
* promise is returned.
* Generators to coroutines. The returned function always returns a promise when invoked. If $worker throws,
* a failed promise is returned.
*
* @param callable (mixed ...$args): mixed $worker
*
Expand Down Expand Up @@ -202,8 +202,8 @@ function pipe($promise, callable $functor): Promise {

/**
* @param \Amp\Promise|\React\Promise\PromiseInterface $promise
* @param string $className Throwable class name to capture. Given callback will only be invoked if the failure reason
* is an instance of the given throwable class name.
* @param string $className Throwable class name to capture. Given callback will only be invoked if the failure
* reason is an instance of the given throwable class name.
* @param callable (\Throwable $exception): mixed $functor
*
* @return \Amp\Promise
Expand Down Expand Up @@ -404,19 +404,19 @@ function first(array $promises): Promise {
throw new UnionTypeError([Promise::class, ReactPromise::class], $promise);
}

$promise->onResolve(function ($exception, $value) use (&$deferred, &$exceptions, &$pending, &$resolved, $key) {
$promise->onResolve(function ($error, $value) use (&$deferred, &$exceptions, &$pending, &$resolved, $key) {
if ($pending === 0) {
return;
}

if (!$exception) {
if (!$error) {
$pending = 0;
$deferred->resolve($value);
$deferred = null;
return;
}

$exceptions[$key] = $exception;
$exceptions[$key] = $error;
if (0 === --$pending) {
$deferred->fail(new MultiReasonException($exceptions));
}
Expand Down Expand Up @@ -500,8 +500,8 @@ function some(array $promises, int $required = 1): Promise {
use Amp\UnionTypeError;

/**
* Creates a stream from the given iterable, emitting the each value. The iterable may contain promises. If any promise
* fails, the stream will fail with the same reason.
* Creates a stream from the given iterable, emitting the each value. The iterable may contain promises. If any
* promise fails, the stream will fail with the same reason.
*
* @param array|\Traversable $iterable Elements to emit.
* @param int $delay Delay between element emissions.
Expand Down

0 comments on commit fed09e4

Please sign in to comment.