diff --git a/src/Rules/Patterns.php b/src/Rules/Patterns.php index e8d45cb..16594c4 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'; }