Add PHP 8.4 to test matrix

This commit is contained in:
Dylan K. Taylor
2025-09-04 21:58:12 +01:00
parent 9a0a8a55b1
commit 1868536916
6 changed files with 103 additions and 9 deletions

View File

@ -0,0 +1,61 @@
parameters:
ignoreErrors:
-
message: '#^Cannot unset property pocketmine\\entity\\Human\:\:\$enderInventory because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Human.php
-
message: '#^Cannot unset property pocketmine\\entity\\Human\:\:\$hungerManager because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Human.php
-
message: '#^Cannot unset property pocketmine\\entity\\Human\:\:\$inventory because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Human.php
-
message: '#^Cannot unset property pocketmine\\entity\\Human\:\:\$offHandInventory because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Human.php
-
message: '#^Cannot unset property pocketmine\\entity\\Human\:\:\$xpManager because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Human.php
-
message: '#^Cannot unset property pocketmine\\entity\\Living\:\:\$armorInventory because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Living.php
-
message: '#^Cannot unset property pocketmine\\entity\\Living\:\:\$effectManager because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/entity/Living.php
-
message: '#^Cannot unset property pocketmine\\player\\Player\:\:\$craftingGrid because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/player/Player.php
-
message: '#^Cannot unset property pocketmine\\player\\Player\:\:\$cursorInventory because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/player/Player.php
-
message: '#^Cannot unset property pocketmine\\world\\format\\io\\leveldb\\LevelDB\:\:\$db because it might have hooks in a subclass\.$#'
identifier: unset.possiblyHookedProperty
count: 1
path: ../../../src/world/format/io/leveldb/LevelDB.php

View File

@ -0,0 +1,31 @@
parameters:
ignoreErrors:
-
message: '#^Call\-site variance of covariant pocketmine\\event\\Event in generic type ReflectionClass\<covariant pocketmine\\event\\Event\> in PHPDoc tag @param for parameter \$class is redundant, template type T of object of class ReflectionClass has the same variance\.$#'
identifier: generics.callSiteVarianceRedundant
count: 2
path: ../../phpunit/event/HandlerListManagerTest.php
-
message: '#^Call\-site variance of covariant pocketmine\\event\\Event in generic type ReflectionClass\<covariant pocketmine\\event\\Event\> in PHPDoc tag @param for parameter \$expect is redundant, template type T of object of class ReflectionClass has the same variance\.$#'
identifier: generics.callSiteVarianceRedundant
count: 1
path: ../../phpunit/event/HandlerListManagerTest.php
-
message: '#^Call\-site variance of covariant pocketmine\\event\\Event in generic type ReflectionClass\<covariant pocketmine\\event\\Event\> in PHPDoc tag @return is redundant, template type T of object of class ReflectionClass has the same variance\.$#'
identifier: generics.callSiteVarianceRedundant
count: 3
path: ../../phpunit/event/HandlerListManagerTest.php
-
message: '#^Call\-site variance of covariant pocketmine\\event\\Event in generic type ReflectionClass\<covariant pocketmine\\event\\Event\> in PHPDoc tag @var for property pocketmine\\event\\HandlerListManagerTest\:\:\$isValidFunc is redundant, template type T of object of class ReflectionClass has the same variance\.$#'
identifier: generics.callSiteVarianceRedundant
count: 1
path: ../../phpunit/event/HandlerListManagerTest.php
-
message: '#^Call\-site variance of covariant pocketmine\\event\\Event in generic type ReflectionClass\<covariant pocketmine\\event\\Event\> in PHPDoc tag @var for property pocketmine\\event\\HandlerListManagerTest\:\:\$resolveParentFunc is redundant, template type T of object of class ReflectionClass has the same variance\.$#'
identifier: generics.callSiteVarianceRedundant
count: 2
path: ../../phpunit/event/HandlerListManagerTest.php

View File

@ -35,12 +35,12 @@ class HandlerListManagerTest extends TestCase{
/**
* @var \Closure
* @phpstan-var \Closure(\ReflectionClass<Event>) : bool
* @phpstan-var \Closure(\ReflectionClass<covariant Event>) : bool
*/
private $isValidFunc;
/**
* @var \Closure
* @phpstan-var \Closure(\ReflectionClass<Event>) : ?\ReflectionClass<Event>
* @phpstan-var \Closure(\ReflectionClass<covariant Event>) : ?\ReflectionClass<covariant Event>
*/
private $resolveParentFunc;
@ -53,7 +53,7 @@ class HandlerListManagerTest extends TestCase{
/**
* @return \Generator|mixed[][]
* @phpstan-return \Generator<int, array{\ReflectionClass<Event>, bool, string}, void, void>
* @phpstan-return \Generator<int, array{\ReflectionClass<covariant Event>, bool, string}, void, void>
*/
public static function isValidClassProvider() : \Generator{
yield [new \ReflectionClass(Event::class), false, "event base should not be handleable"];
@ -65,7 +65,7 @@ class HandlerListManagerTest extends TestCase{
/**
* @dataProvider isValidClassProvider
*
* @phpstan-param \ReflectionClass<Event> $class
* @phpstan-param \ReflectionClass<covariant Event> $class
*/
public function testIsValidClass(\ReflectionClass $class, bool $isValid, string $reason) : void{
self::assertSame($isValid, ($this->isValidFunc)($class), $reason);
@ -73,7 +73,7 @@ class HandlerListManagerTest extends TestCase{
/**
* @return \Generator|\ReflectionClass[][]
* @phpstan-return \Generator<int, array{\ReflectionClass<Event>, \ReflectionClass<Event>|null}, void, void>
* @phpstan-return \Generator<int, array{\ReflectionClass<covariant Event>, \ReflectionClass<covariant Event>|null}, void, void>
*/
public static function resolveParentClassProvider() : \Generator{
yield [new \ReflectionClass(TestConcreteExtendsAllowHandleEvent::class), new \ReflectionClass(TestAbstractAllowHandleEvent::class)];
@ -85,8 +85,8 @@ class HandlerListManagerTest extends TestCase{
/**
* @dataProvider resolveParentClassProvider
*
* @phpstan-param \ReflectionClass<Event> $class
* @phpstan-param \ReflectionClass<Event>|null $expect
* @phpstan-param \ReflectionClass<covariant Event> $class
* @phpstan-param \ReflectionClass<covariant Event>|null $expect
*/
public function testResolveParentClass(\ReflectionClass $class, ?\ReflectionClass $expect) : void{
if($expect === null){