diff --git a/lib/EmitterInterface.php b/lib/EmitterInterface.php index 1f0d920..05b0513 100644 --- a/lib/EmitterInterface.php +++ b/lib/EmitterInterface.php @@ -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 $arguments + * @param list $arguments * @param callable():bool|null $continueCallBack */ public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool; diff --git a/lib/EmitterTrait.php b/lib/EmitterTrait.php index fdd376d..a53a7a9 100644 --- a/lib/EmitterTrait.php +++ b/lib/EmitterTrait.php @@ -172,7 +172,7 @@ public function removeAllListeners(string $eventName = null): void /** * The list of listeners. * - * @var array, 2:array}> + * @var array, 2:list}> */ protected array $listeners = []; } diff --git a/lib/Loop/Loop.php b/lib/Loop/Loop.php index 5a9ef5d..2f9bdaa 100644 --- a/lib/Loop/Loop.php +++ b/lib/Loop/Loop.php @@ -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 + * @return IntervalStatus */ public function setInterval(callable $cb, float $timeout): array { @@ -88,7 +88,7 @@ public function setInterval(callable $cb, float $timeout): array /** * Stops a running interval. * - * @param array $intervalId + * @param IntervalStatus $intervalId */ public function clearInterval(array $intervalId): void { @@ -302,7 +302,7 @@ protected function runStreams(?float $timeout): void /** * A list of timers, added by setTimeout. * - * @var array + * @var list */ protected array $timers = []; diff --git a/lib/Loop/functions.php b/lib/Loop/functions.php index 541427d..216c0e6 100644 --- a/lib/Loop/functions.php +++ b/lib/Loop/functions.php @@ -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 + * @return IntervalStatus */ function setInterval(callable $cb, float $timeout): array { @@ -28,7 +28,7 @@ function setInterval(callable $cb, float $timeout): array /** * Stops a running interval. * - * @param array $intervalId + * @param IntervalStatus $intervalId */ function clearInterval(array $intervalId): void { diff --git a/lib/Promise.php b/lib/Promise.php index 4c86ee2..5d6e3b1 100644 --- a/lib/Promise.php +++ b/lib/Promise.php @@ -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, 1:callable|null, 2:callable|null}> + * @var list, 1:callable|null, 2:callable|null}> */ protected array $subscribers = []; diff --git a/lib/WildcardEmitterTrait.php b/lib/WildcardEmitterTrait.php index af8432f..1a4c69c 100644 --- a/lib/WildcardEmitterTrait.php +++ b/lib/WildcardEmitterTrait.php @@ -216,14 +216,14 @@ public function removeAllListeners(string $eventName = null): void /** * The list of listeners. * - * @var array> + * @var array> */ protected array $listeners = []; /** * The list of "wildcard listeners". * - * @var array> + * @var array> */ protected array $wildcardListeners = []; @@ -233,7 +233,7 @@ public function removeAllListeners(string $eventName = null): void * * If the list of listeners changes though, the index clears. * - * @var array> + * @var array> */ protected array $listenerIndex = []; } diff --git a/phpstan.neon b/phpstan.neon index 4b77189..a52fa03 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,8 @@ parameters: level: 9 phpVersion: 70430 # PHP 7.4.30 + typeAliases: + IntervalStatus: 'array{0:string, 1:boolean}' ignoreErrors: - message: "#^If condition is always true.$#"