From 3ca8344118980472e4a0bc70cf7638ed07bad805 Mon Sep 17 00:00:00 2001 From: Antonio Mangiacapra <11173091+antonioeatgoat@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:06:42 +0200 Subject: [PATCH] Fix RiskyTruthyFalsyComparison (#94) --- Inpsyde/Helpers/FunctionDocBlock.php | 2 +- psalm.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Inpsyde/Helpers/FunctionDocBlock.php b/Inpsyde/Helpers/FunctionDocBlock.php index baf6071..95b1f19 100644 --- a/Inpsyde/Helpers/FunctionDocBlock.php +++ b/Inpsyde/Helpers/FunctionDocBlock.php @@ -101,7 +101,7 @@ public static function tag(string $tag, File $file, int $position): array { $tagName = '@' . ltrim($tag, '@'); $tags = static::allTags($file, $position); - if (empty($tags[$tagName])) { + if (!isset($tags[$tagName]) || $tags[$tagName] === []) { return []; } diff --git a/psalm.xml b/psalm.xml index d6771a0..1f0adf6 100644 --- a/psalm.xml +++ b/psalm.xml @@ -27,5 +27,8 @@ + + +