mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-29 22:45:00 +00:00
phpstan: enable checkMissingCallableSignature
This commit is contained in:
parent
af8936dba5
commit
34c1d455a7
@ -17,6 +17,7 @@ includes:
|
|||||||
parameters:
|
parameters:
|
||||||
level: 8
|
level: 8
|
||||||
checkExplicitMixed: true
|
checkExplicitMixed: true
|
||||||
|
checkMissingCallableSignature: true
|
||||||
bootstrapFiles:
|
bootstrapFiles:
|
||||||
- tests/phpstan/bootstrap.php
|
- tests/phpstan/bootstrap.php
|
||||||
scanDirectories:
|
scanDirectories:
|
||||||
|
@ -701,6 +701,7 @@ class PluginManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$handlerClosure = $method->getClosure($listener);
|
$handlerClosure = $method->getClosure($listener);
|
||||||
|
if($handlerClosure === null) throw new AssumptionFailedError("This should never happen");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$paramType = $parameters[0]->getType();
|
$paramType = $parameters[0]->getType();
|
||||||
|
@ -117,6 +117,8 @@ class Utils{
|
|||||||
/**
|
/**
|
||||||
* Generates an unique identifier to a callable
|
* Generates an unique identifier to a callable
|
||||||
*
|
*
|
||||||
|
* @phpstan-param callable(mixed...) : mixed $variable
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getCallableIdentifier(callable $variable){
|
public static function getCallableIdentifier(callable $variable){
|
||||||
@ -132,6 +134,7 @@ class Utils{
|
|||||||
/**
|
/**
|
||||||
* Returns a readable identifier for the given Closure, including file and line.
|
* Returns a readable identifier for the given Closure, including file and line.
|
||||||
*
|
*
|
||||||
|
* @phpstan-param \Closure(mixed...) : mixed $closure
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
*/
|
*/
|
||||||
public static function getNiceClosureName(\Closure $closure) : string{
|
public static function getNiceClosureName(\Closure $closure) : string{
|
||||||
@ -685,6 +688,8 @@ class Utils{
|
|||||||
*
|
*
|
||||||
* @param callable $signature Dummy callable with the required parameters and return type
|
* @param callable $signature Dummy callable with the required parameters and return type
|
||||||
* @param callable $subject Callable to check the signature of
|
* @param callable $subject Callable to check the signature of
|
||||||
|
* @phpstan-param callable(mixed...) : mixed $signature
|
||||||
|
* @phpstan-param callable(mixed...) : mixed $subject
|
||||||
*
|
*
|
||||||
* @throws \DaveRandom\CallbackValidator\InvalidCallbackException
|
* @throws \DaveRandom\CallbackValidator\InvalidCallbackException
|
||||||
* @throws \TypeError
|
* @throws \TypeError
|
||||||
|
@ -1485,11 +1485,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/pocketmine/plugin/PluginBase.php
|
path: ../../../src/pocketmine/plugin/PluginBase.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$closure of static method pocketmine\\\\utils\\\\Utils\\:\\:getNiceClosureName\\(\\) expects Closure, Closure\\|null given\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../../src/pocketmine/plugin/PluginManager.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot call method handleException\\(\\) on pocketmine\\\\scheduler\\\\AsyncWorker\\|null\\.$#"
|
message: "#^Cannot call method handleException\\(\\) on pocketmine\\\\scheduler\\\\AsyncWorker\\|null\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user