From 603e015f2c81118a8f42930140311d125eba6f8a Mon Sep 17 00:00:00 2001 From: Michael Kopinsky Date: Thu, 21 Nov 2024 17:10:41 -0500 Subject: [PATCH] Update `YearMatch` to include recent (and upcoming) years --- src/Matchers/YearMatch.php | 2 +- test/Matchers/YearTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Matchers/YearMatch.php b/src/Matchers/YearMatch.php index ebabf6b..84f711c 100644 --- a/src/Matchers/YearMatch.php +++ b/src/Matchers/YearMatch.php @@ -23,7 +23,7 @@ final class YearMatch extends BaseMatch public static function match(string $password, array $userInputs = []): array { $matches = []; - $groups = static::findAll($password, "/(19\d\d|200\d|201\d)/u"); + $groups = static::findAll($password, "/(19\d\d|20\d\d)/u"); foreach ($groups as $captures) { $matches[] = new static($password, $captures[1]['begin'], $captures[1]['end'], $captures[1]['token']); } diff --git a/test/Matchers/YearTest.php b/test/Matchers/YearTest.php index c7c5400..19a094d 100644 --- a/test/Matchers/YearTest.php +++ b/test/Matchers/YearTest.php @@ -48,7 +48,7 @@ public function nonRecentYearProvider() return [ ['1420'], ['1899'], - ['2020'] + ['2345'] ]; }