Skip to content

Commit 7c7d1d7

Browse files
committed
More types
1 parent 52e5da9 commit 7c7d1d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/functions.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ function ($error) use (&$exception, &$rejected, &$wait) {
9494
* @param array<callable():PromiseInterface<mixed,Exception>> $tasks
9595
* @return PromiseInterface<array<mixed>,Exception>
9696
*/
97-
function parallel(array $tasks)
97+
function parallel(array $tasks): PromiseInterface
9898
{
9999
$deferred = new Deferred();
100-
$results = array();
101-
$errors = array();
100+
$results = [];
101+
$errors = [];
102102

103103
$done = function () use (&$results, &$errors, $deferred) {
104104
if (count($errors)) {
@@ -145,10 +145,10 @@ function parallel(array $tasks)
145145
* @param array<callable():PromiseInterface<mixed,Exception>> $tasks
146146
* @return PromiseInterface<array<mixed>,Exception>
147147
*/
148-
function series(array $tasks)
148+
function series(array $tasks): PromiseInterface
149149
{
150150
$deferred = new Deferred();
151-
$results = array();
151+
$results = [];
152152

153153
/** @var callable():void $next */
154154
$taskCallback = function ($result) use (&$results, &$next) {
@@ -178,7 +178,7 @@ function series(array $tasks)
178178
* @param array<callable(mixed=):PromiseInterface<mixed,Exception>> $tasks
179179
* @return PromiseInterface<mixed,Exception>
180180
*/
181-
function waterfall(array $tasks)
181+
function waterfall(array $tasks): PromiseInterface
182182
{
183183
$deferred = new Deferred();
184184

0 commit comments

Comments
 (0)