ah hello my old friend, impossible-generics.neon

propagating generics all the way through the likes of HandlerList etc is more trouble than it's worth.
This commit is contained in:
Dylan K. Taylor 2024-11-13 19:09:52 +00:00
parent 32b1d6c0c2
commit fa796535ff
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 13 additions and 3 deletions

View File

@ -29,9 +29,6 @@ use pocketmine\timings\TimingsHandler;
use function in_array;
class AsyncRegisteredListener{
/**
* @phpstan-param \Closure(AsyncEvent) : ?Promise<null> $handler
*/
public function __construct(
private \Closure $handler,
private int $priority,

View File

@ -1,5 +1,15 @@
parameters:
ignoreErrors:
-
message: "#^Method pocketmine\\\\event\\\\AsyncRegisteredListener\\:\\:__construct\\(\\) has parameter \\$handler with no signature specified for Closure\\.$#"
count: 1
path: ../../../src/event/AsyncRegisteredListener.php
-
message: "#^Method pocketmine\\\\event\\\\AsyncRegisteredListener\\:\\:getHandler\\(\\) return type has no signature specified for Closure\\.$#"
count: 1
path: ../../../src/event/AsyncRegisteredListener.php
-
message: "#^Method pocketmine\\\\event\\\\RegisteredListener\\:\\:__construct\\(\\) has parameter \\$handler with no signature specified for Closure\\.$#"
count: 1

View File

@ -39,6 +39,9 @@ final class AsyncEventInheritanceTest extends Test{
ChildAsyncEvent::class,
ParentAsyncEvent::class
];
/**
* @var string[]
*/
private array $callOrder = [];
public function getName() : string{