Skip to content

Commit

Permalink
Merge pull request #116 from phil-davis/phpdoc-list-2
Browse files Browse the repository at this point in the history
Change array<int...> to list<...> in PHP doc
  • Loading branch information
phil-davis authored Nov 20, 2023
2 parents 8112929 + 1f025c8 commit b7793b7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/EmitterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*
* @param array<int, mixed> $arguments
* @param list<mixed> $arguments
* @param callable():bool|null $continueCallBack
*/
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool;
Expand Down
2 changes: 1 addition & 1 deletion lib/EmitterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function removeAllListeners(string $eventName = null): void
/**
* The list of listeners.
*
* @var array<string, array{0:boolean, 1:array<int, mixed>, 2:array<int, callable>}>
* @var array<string, array{0:boolean, 1:list<mixed>, 2:list<callable>}>
*/
protected array $listeners = [];
}
6 changes: 3 additions & 3 deletions lib/Loop/Loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setTimeout(callable $cb, float $timeout): void
* The value this function returns can be used to stop the interval with
* clearInterval.
*
* @return array<int, mixed>
* @return array{0:string, 1:boolean}
*/
public function setInterval(callable $cb, float $timeout): array
{
Expand All @@ -88,7 +88,7 @@ public function setInterval(callable $cb, float $timeout): array
/**
* Stops a running interval.
*
* @param array<int, mixed> $intervalId
* @param array{0:string, 1:boolean} $intervalId
*/
public function clearInterval(array $intervalId): void
{
Expand Down Expand Up @@ -302,7 +302,7 @@ protected function runStreams(?float $timeout): void
/**
* A list of timers, added by setTimeout.
*
* @var array<int, array{0:float, 1:callable}>
* @var list<array{0:float, 1:callable}>
*/
protected array $timers = [];

Expand Down
4 changes: 2 additions & 2 deletions lib/Loop/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function setTimeout(callable $cb, float $timeout): void
* The value this function returns can be used to stop the interval with
* clearInterval.
*
* @return array<int, mixed>
* @return array{0:string, 1:boolean}
*/
function setInterval(callable $cb, float $timeout): array
{
Expand All @@ -28,7 +28,7 @@ function setInterval(callable $cb, float $timeout): array
/**
* Stops a running interval.
*
* @param array<int, mixed> $intervalId
* @param array{0:string, 1:boolean} $intervalId
*/
function clearInterval(array $intervalId): void
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function wait()
* A list of subscribers. Subscribers are the callbacks that want us to let
* them know if the callback was fulfilled or rejected.
*
* @var array<int, array{0:Promise<TReturn>, 1:callable|null, 2:callable|null}>
* @var list<array{0:Promise<TReturn>, 1:callable|null, 2:callable|null}>
*/
protected array $subscribers = [];

Expand Down
6 changes: 3 additions & 3 deletions lib/WildcardEmitterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ public function removeAllListeners(string $eventName = null): void
/**
* The list of listeners.
*
* @var array<string, array<int, array{0:int, 1:callable}>>
* @var array<string, list<array{0:int, 1:callable}>>
*/
protected array $listeners = [];

/**
* The list of "wildcard listeners".
*
* @var array<string, array<int, array{0:int, 1:callable}>>
* @var array<string, list<array{0:int, 1:callable}>>
*/
protected array $wildcardListeners = [];

Expand All @@ -233,7 +233,7 @@ public function removeAllListeners(string $eventName = null): void
*
* If the list of listeners changes though, the index clears.
*
* @var array<string, array<int, callable>>
* @var array<string, list<callable>>
*/
protected array $listenerIndex = [];
}

0 comments on commit b7793b7

Please sign in to comment.