From 480708637b8309ea7cd7675d827e05a7f50a6dab Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Sun, 1 Oct 2023 21:32:34 +0200 Subject: [PATCH 1/2] Fix https://psalm.dev/r/77be914054 --- src/Psalm/Issue/InternalClass.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Psalm/Issue/InternalClass.php b/src/Psalm/Issue/InternalClass.php index 827c90134..93af91b46 100644 --- a/src/Psalm/Issue/InternalClass.php +++ b/src/Psalm/Issue/InternalClass.php @@ -2,6 +2,7 @@ namespace Psalm\Issue; +use function array_unique; use function array_pop; use function count; use function implode; @@ -15,6 +16,7 @@ final class InternalClass extends ClassIssue /** @param non-empty-list $words */ public static function listToPhrase(array $words): string { + $words = array_unique($words); if (count($words) === 1) { return reset($words); } From 1306b62fed8afc0aed9fffa2aa51f704d2bc04a9 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Sun, 1 Oct 2023 21:35:45 +0200 Subject: [PATCH 2/2] code style --- src/Psalm/Issue/InternalClass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Issue/InternalClass.php b/src/Psalm/Issue/InternalClass.php index 93af91b46..087eece02 100644 --- a/src/Psalm/Issue/InternalClass.php +++ b/src/Psalm/Issue/InternalClass.php @@ -2,8 +2,8 @@ namespace Psalm\Issue; -use function array_unique; use function array_pop; +use function array_unique; use function count; use function implode; use function reset;