From a469607b9d33eaff4ba786a1e7e8e3be8b573af6 Mon Sep 17 00:00:00 2001 From: Phil Bates Date: Sat, 27 Jan 2024 10:31:36 +0000 Subject: [PATCH] PHPStan: Ignore "Dynamic call to static method" errors The following route: Route::get('/', function(\Illuminate\Contracts\Filesystem\Filesystem $factory) { return $factory->download('foo.csv'); }); currently results in the following false-positive error: ------ ------------------------------------------------------------------------------------ Line routes/web.php ------ ------------------------------------------------------------------------------------ 22 Dynamic call to static method Illuminate\Filesystem\FilesystemAdapter::download(). ------ ------------------------------------------------------------------------------------ See https://github.com/phpstan/phpstan-strict-rules/issues/140 See https://github.com/larastan/larastan/issues/1272 --- phpstan.neon.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 0db6c69..6b2b7e4 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -16,3 +16,7 @@ parameters: level: 9 excludePaths: - bootstrap/cache/ + strictRules: + # TODO remove when https://github.com/phpstan/phpstan-strict-rules/issues/140 is resolved + # See also: https://github.com/larastan/larastan/issues/1272 + strictCalls: false