Skip to content

Commit

Permalink
Easy wins for PHPStan 2.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Nov 12, 2024
1 parent fe70150 commit f3cc4a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ public function generateStatePermutations() : \Generator{
*
* 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;
Expand Down
5 changes: 5 additions & 0 deletions src/data/runtime/RuntimeDataDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public function railShape(int &$railShape) : void;

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;

/**
Expand Down

0 comments on commit f3cc4a2

Please sign in to comment.