From c21adbc99d97c4ca12d77f647df7154681e8b3f7 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sat, 12 Feb 2022 09:24:58 +0900 Subject: [PATCH 1/3] Declare as ext-filter is require obvisioly --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 107ccf801b8..3f02fe1a8f2 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "ext-SimpleXML": "*", "ext-ctype": "*", "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", From 5d68760e7586b3421363a246e9ec62b3b212b6a6 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sat, 12 Feb 2022 09:28:11 +0900 Subject: [PATCH 2/3] Added ext-pcntl, ext-posix to composer.json suggest property --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3f02fe1a8f2..0c8d5a921d1 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,9 @@ }, "suggest": { "ext-igbinary": "^2.0.5 is required, used to serialize caching data", - "ext-curl": "In order to send data to shepherd" + "ext-curl": "In order to send data to shepherd", + "ext-pcntl": "In order to run psalm-language-server", + "ext-posix": "In order to run psalm-language-server" }, "config": { "allow-plugins": { From 4e1c2bcd9669bbcd6d7a7ff947a6104b2c8b6510 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sat, 12 Feb 2022 09:38:03 +0900 Subject: [PATCH 3/3] use PDOException literal instead of ::class to avoid taken as dependency --- bin/composer-require-checker-config.json | 3 +-- .../Expression/Call/Method/MethodCallReturnTypeFetcher.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/composer-require-checker-config.json b/bin/composer-require-checker-config.json index 753f91dd159..f5086b03461 100644 --- a/bin/composer-require-checker-config.json +++ b/bin/composer-require-checker-config.json @@ -18,8 +18,7 @@ "pcntl", "posix", "filter", - "curl", - "PDO" + "curl" ], "scan-files" : [] } diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php index 2da1db04209..badb954fa74 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php @@ -3,7 +3,6 @@ namespace Psalm\Internal\Analyzer\Statements\Expression\Call\Method; use Exception; -use PDOException; use PhpParser; use Psalm\CodeLocation; use Psalm\Codebase; @@ -105,7 +104,7 @@ public static function fetch( || $codebase->interfaceExtends($premixin_method_id->fq_class_name, Throwable::class) ) ) { - if ($premixin_method_id->fq_class_name === PDOException::class) { + if ($premixin_method_id->fq_class_name === 'PDOException') { return Type::getString(); } else { return Type::getInt(true); // TODO: Remove the flag in Psalm 5