Easy wins for PHPStan 2.0 support

This commit is contained in:
Dylan K. Taylor 2024-11-12 22:12:54 +00:00
parent fe70150db2
commit f3cc4a28e1
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 7 additions and 2 deletions

View File

@ -48,8 +48,6 @@ parameters:
- tests/phpstan/stubs/leveldb.stub
- tests/phpstan/stubs/pmmpthread.stub
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
staticReflectionClassNamePatterns:
- "#^COM$#"
typeAliases:
#variadics don't work for this - mixed probably shouldn't work either, but for now it does
#what we actually need is something that accepts an infinite number of parameters, but in the absence of that,

View File

@ -362,6 +362,8 @@ class Block{
*
* A replacement block may be returned. This is useful if the block type changed due to reading of world data (e.g.
* data from a block entity).
*
* @phpstan-impure
*/
public function readStateFromWorld() : Block{
return $this;

View File

@ -89,6 +89,11 @@ interface RuntimeDataDescriber extends RuntimeEnumDescriber{
public function straightOnlyRailShape(int &$railShape) : void;
/**
* @phpstan-template T of \UnitEnum
* @phpstan-param T &$case
* @phpstan-param-out T &$case
*/
public function enum(\UnitEnum &$case) : void;
/**