Skip to content

Commit 5928721

Browse files
committed
This actually needs to use new static
1 parent 70bab44 commit 5928721

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

phpstan-baseline.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Unsafe usage of new static\(\)\.$#'
5+
identifier: new.static
6+
count: 1
7+
path: src/Matchers/DictionaryMatch.php

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
14
parameters:
25
level: 0
36
paths:

src/Matchers/DictionaryMatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function match(string $password, array $userInputs = [], array $ra
6262
$results = static::dictionaryMatch($password, $dict);
6363
foreach ($results as $result) {
6464
$result['dictionary_name'] = $name;
65-
$matches[] = new DictionaryMatch($password, $result['begin'], $result['end'], $result['token'], $result);
65+
$matches[] = new static($password, $result['begin'], $result['end'], $result['token'], $result);
6666
}
6767
}
6868
Matcher::usortStable($matches, [Matcher::class, 'compareMatches']);

0 commit comments

Comments
 (0)