1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Suppress UndefinedMethod for Php 7.0 Psalm check

This commit is contained in:
Matthew Brown 2019-02-15 18:41:30 -05:00
parent 149d7cab1c
commit 0c9c8c204c

View File

@ -53,6 +53,7 @@ class FunctionReturnTypeProvider
public function register(string $class)
{
if (version_compare(PHP_VERSION, '7.1.0') >= 0) {
/** @psalm-suppress UndefinedMethod */
$callable = \Closure::fromCallable([$class, 'get']);
} else {
$callable = (new \ReflectionClass($class))->getMethod('get')->getClosure(new $class);