diff --git a/src/Psalm/Internal/Provider/FunctionExistenceProvider.php b/src/Psalm/Internal/Provider/FunctionExistenceProvider.php index f5527c980..7e84726d4 100644 --- a/src/Psalm/Internal/Provider/FunctionExistenceProvider.php +++ b/src/Psalm/Internal/Provider/FunctionExistenceProvider.php @@ -36,7 +36,7 @@ final class FunctionExistenceProvider public function registerClass(string $class): void { if (is_subclass_of($class, FunctionExistenceProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'doesFunctionExist']); + $callable = $class::doesFunctionExist(...); foreach ($class::getFunctionIds() as $function_id) { $this->registerClosure($function_id, $callable); diff --git a/src/Psalm/Internal/Provider/FunctionParamsProvider.php b/src/Psalm/Internal/Provider/FunctionParamsProvider.php index 976b8033f..ce852dc88 100644 --- a/src/Psalm/Internal/Provider/FunctionParamsProvider.php +++ b/src/Psalm/Internal/Provider/FunctionParamsProvider.php @@ -38,7 +38,7 @@ final class FunctionParamsProvider */ public function registerClass(string $class): void { - $callable = Closure::fromCallable([$class, 'getFunctionParams']); + $callable = $class::getFunctionParams(...); foreach ($class::getFunctionIds() as $function_id) { $this->registerClosure($function_id, $callable); diff --git a/src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php b/src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php index de3a11462..228010cb8 100644 --- a/src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php @@ -117,7 +117,7 @@ final class FunctionReturnTypeProvider public function registerClass(string $class): void { if (is_subclass_of($class, FunctionReturnTypeProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'getFunctionReturnType']); + $callable = $class::getFunctionReturnType(...); foreach ($class::getFunctionIds() as $function_id) { $this->registerClosure($function_id, $callable); diff --git a/src/Psalm/Internal/Provider/MethodExistenceProvider.php b/src/Psalm/Internal/Provider/MethodExistenceProvider.php index 657fddd0d..af345f77e 100644 --- a/src/Psalm/Internal/Provider/MethodExistenceProvider.php +++ b/src/Psalm/Internal/Provider/MethodExistenceProvider.php @@ -35,7 +35,7 @@ final class MethodExistenceProvider */ public function registerClass(string $class): void { - $callable = Closure::fromCallable([$class, 'doesMethodExist']); + $callable = $class::doesMethodExist(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable); diff --git a/src/Psalm/Internal/Provider/MethodParamsProvider.php b/src/Psalm/Internal/Provider/MethodParamsProvider.php index 58e225b78..8599c4b29 100644 --- a/src/Psalm/Internal/Provider/MethodParamsProvider.php +++ b/src/Psalm/Internal/Provider/MethodParamsProvider.php @@ -44,7 +44,7 @@ final class MethodParamsProvider public function registerClass(string $class): void { if (is_subclass_of($class, MethodParamsProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'getMethodParams']); + $callable = $class::getMethodParams(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable); diff --git a/src/Psalm/Internal/Provider/MethodReturnTypeProvider.php b/src/Psalm/Internal/Provider/MethodReturnTypeProvider.php index 575b257ca..1e57683a2 100644 --- a/src/Psalm/Internal/Provider/MethodReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/MethodReturnTypeProvider.php @@ -51,7 +51,7 @@ final class MethodReturnTypeProvider public function registerClass(string $class): void { if (is_subclass_of($class, MethodReturnTypeProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'getMethodReturnType']); + $callable = $class::getMethodReturnType(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable); diff --git a/src/Psalm/Internal/Provider/MethodVisibilityProvider.php b/src/Psalm/Internal/Provider/MethodVisibilityProvider.php index fcda0291d..a9d888256 100644 --- a/src/Psalm/Internal/Provider/MethodVisibilityProvider.php +++ b/src/Psalm/Internal/Provider/MethodVisibilityProvider.php @@ -39,7 +39,7 @@ final class MethodVisibilityProvider public function registerClass(string $class): void { if (is_subclass_of($class, MethodVisibilityProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'isMethodVisible']); + $callable = $class::isMethodVisible(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable); diff --git a/src/Psalm/Internal/Provider/PropertyExistenceProvider.php b/src/Psalm/Internal/Provider/PropertyExistenceProvider.php index d10e6f247..9f6e7b1a5 100644 --- a/src/Psalm/Internal/Provider/PropertyExistenceProvider.php +++ b/src/Psalm/Internal/Provider/PropertyExistenceProvider.php @@ -39,7 +39,7 @@ final class PropertyExistenceProvider public function registerClass(string $class): void { if (is_subclass_of($class, PropertyExistenceProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'doesPropertyExist']); + $callable = $class::doesPropertyExist(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable); diff --git a/src/Psalm/Internal/Provider/PropertyTypeProvider.php b/src/Psalm/Internal/Provider/PropertyTypeProvider.php index 71b9231a7..19687569a 100644 --- a/src/Psalm/Internal/Provider/PropertyTypeProvider.php +++ b/src/Psalm/Internal/Provider/PropertyTypeProvider.php @@ -41,7 +41,7 @@ final class PropertyTypeProvider public function registerClass(string $class): void { if (is_subclass_of($class, PropertyTypeProviderInterface::class, true)) { - $callable = Closure::fromCallable([$class, 'getPropertyType']); + $callable = $class::getPropertyType(...); foreach ($class::getClassLikeNames() as $fq_classlike_name) { $this->registerClosure($fq_classlike_name, $callable);