From 2aa9413c13c4aefe6baf845e170c99c05712a6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 28 May 2024 21:21:12 +0200 Subject: [PATCH] Remove unused private property I found this thanks to Psalm. I was curious to try setting findUnusedCode to true. --- src/Rules/Patterns.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Rules/Patterns.php b/src/Rules/Patterns.php index e8d45cb7..16594c4f 100644 --- a/src/Rules/Patterns.php +++ b/src/Rules/Patterns.php @@ -10,19 +10,14 @@ class Patterns { - /** @var Pattern[] */ - private $patterns; - /** @var string */ private $regex; public function __construct(Pattern ...$patterns) { - $this->patterns = $patterns; - $patterns = array_map(static function (Pattern $pattern): string { return $pattern->getPattern(); - }, $this->patterns); + }, $patterns); $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; }