1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace Createnl\ZxcvbnBundle; |
||
5 | |||
6 | use Symfony\Contracts\Translation\TranslatorInterface; |
||
7 | use ZxcvbnPhp\Matchers\MatchInterface; |
||
8 | use ZxcvbnPhp\Zxcvbn; |
||
9 | |||
10 | class ZxcvbnFactory implements ZxcvbnFactoryInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var MatchInterface[] |
||
14 | */ |
||
15 | private $additionalMatchers; |
||
16 | /** |
||
17 | * @var TranslatorInterface |
||
18 | */ |
||
19 | private $translator; |
||
20 | |||
21 | 1 | public function __construct(iterable $additionalMatchers, TranslatorInterface $translator) |
|
22 | { |
||
23 | 1 | $this->additionalMatchers = $additionalMatchers; |
|
0 ignored issues
–
show
|
|||
24 | 1 | $this->translator = $translator; |
|
25 | 1 | } |
|
26 | |||
27 | 1 | public function createZxcvbn(): Zxcvbn |
|
28 | { |
||
29 | 1 | $zxcvn = new ZxcvbnTranslation( |
|
30 | 1 | new Zxcvbn(), |
|
31 | 1 | $this->translator |
|
32 | ); |
||
33 | |||
34 | 1 | foreach ($this->additionalMatchers as $matcher) { |
|
35 | 1 | $zxcvn->addMatcher(get_class($matcher)); |
|
36 | } |
||
37 | |||
38 | 1 | return $zxcvn; |
|
39 | } |
||
40 | } |
||
41 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..