@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $decodeMap = []; |
59 | 59 | foreach ($this->decodeMap as $encodedChar => $chars) { |
60 | - if ((string)$encodedChar === mb_substr($word, 0, mb_strlen((string)$encodedChar))) { |
|
60 | + if ((string) $encodedChar === mb_substr($word, 0, mb_strlen((string) $encodedChar))) { |
|
61 | 61 | $decodeMap[$encodedChar] = $chars; |
62 | 62 | } |
63 | 63 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | foreach ($this->getDecodeMap($word) as $encodedChar => $chars) { |
80 | - foreach ($this->convert(mb_substr($word, mb_strlen((string)$encodedChar))) as $suffix) { |
|
80 | + foreach ($this->convert(mb_substr($word, mb_strlen((string) $encodedChar))) as $suffix) { |
|
81 | 81 | foreach ($chars as $char) { |
82 | 82 | yield $char.$suffix; |
83 | 83 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return true; |
109 | 109 | } |
110 | 110 | |
111 | - $word = $this->getDictionaryWord((string)$password); |
|
111 | + $word = $this->getDictionaryWord((string) $password); |
|
112 | 112 | |
113 | 113 | return $word === null; |
114 | 114 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function validate($password): ?ValidationError |
120 | 120 | { |
121 | - $word = $this->getDictionaryWord((string)$password); |
|
121 | + $word = $this->getDictionaryWord((string) $password); |
|
122 | 122 | |
123 | 123 | if ($word !== null) { |
124 | 124 | return new ValidationError( |
@@ -133,7 +133,7 @@ |
||
133 | 133 | $guessableData = array_merge($guessableData, $password->getGuessableData()); |
134 | 134 | } |
135 | 135 | |
136 | - foreach ($this->getWordsToCheck((string)$password) as $word) { |
|
136 | + foreach ($this->getWordsToCheck((string) $password) as $word) { |
|
137 | 137 | foreach ($guessableData as $data) { |
138 | 138 | if ($this->contains($word, $data)) { |
139 | 139 | return $data; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | { |
81 | 81 | $this->formerPasswords = array_merge($this->formerPasswords, $formerPasswords); |
82 | 82 | |
83 | - StableSort::usort($this->formerPasswords, static function (FormerPassword $a, FormerPassword $b): int { |
|
83 | + StableSort::usort($this->formerPasswords, static function(FormerPassword $a, FormerPassword $b): int { |
|
84 | 84 | return $b->getDate() <=> $a->getDate(); |
85 | 85 | }); |
86 | 86 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $this->constraints[] = new Date($min, $max, $weight); |
43 | 43 | |
44 | - StableSort::usort($this->constraints, static function (Date $a, Date $b): int { |
|
44 | + StableSort::usort($this->constraints, static function(Date $a, Date $b): int { |
|
45 | 45 | return $b->getWeight() <=> $a->getWeight(); |
46 | 46 | }); |
47 | 47 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->constraints[] = new Count($min, $max, $weight); |
40 | 40 | |
41 | - StableSort::usort($this->constraints, static function (Count $a, Count $b): int { |
|
41 | + StableSort::usort($this->constraints, static function(Count $a, Count $b): int { |
|
42 | 42 | return $b->getWeight() <=> $a->getWeight(); |
43 | 43 | }); |
44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function test($password, ?int $weight = 1): bool |
56 | 56 | { |
57 | - $count = $this->getCount((string)$password); |
|
57 | + $count = $this->getCount((string) $password); |
|
58 | 58 | $constraint = $this->getViolation($count, $weight); |
59 | 59 | |
60 | 60 | return $constraint === null; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function validate($password): ?ValidationError |
70 | 70 | { |
71 | - $count = $this->getCount((string)$password); |
|
71 | + $count = $this->getCount((string) $password); |
|
72 | 72 | $constraint = $this->getViolation($count); |
73 | 73 | |
74 | 74 | if ($constraint !== null) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $this->constraints[] = new Position($first, $count, $weight); |
48 | 48 | |
49 | - StableSort::usort($this->constraints, static function (Position $a, Position $b): int { |
|
49 | + StableSort::usort($this->constraints, static function(Position $a, Position $b): int { |
|
50 | 50 | return $b->getWeight() <=> $a->getWeight(); |
51 | 51 | }); |
52 | 52 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($password instanceof Password) { |
132 | 132 | $position = 0; |
133 | 133 | foreach ($password->getFormerPasswords() as $formerPassword) { |
134 | - if ($this->hashFunction->compare((string)$password, (string)$formerPassword)) { |
|
134 | + if ($this->hashFunction->compare((string) $password, (string) $formerPassword)) { |
|
135 | 135 | $positions[] = $position; |
136 | 136 | } |
137 | 137 | ++$position; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $this->constraints[] = new Count($min, $max, $weight); |
51 | 51 | |
52 | - StableSort::usort($this->constraints, static function (Count $a, Count $b): int { |
|
52 | + StableSort::usort($this->constraints, static function(Count $a, Count $b): int { |
|
53 | 53 | return $b->getWeight() <=> $a->getWeight(); |
54 | 54 | }); |
55 | 55 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function test($password, ?int $weight = 1): bool |
75 | 75 | { |
76 | - $count = $this->getCount((string)$password); |
|
76 | + $count = $this->getCount((string) $password); |
|
77 | 77 | $constraint = $this->getViolation($count, $weight); |
78 | 78 | |
79 | 79 | return $constraint === null; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function validate($password): ?ValidationError |
89 | 89 | { |
90 | - $count = $this->getCount((string)$password); |
|
90 | + $count = $this->getCount((string) $password); |
|
91 | 91 | $constraint = $this->getViolation($count); |
92 | 92 | |
93 | 93 | if ($constraint !== null) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->constraints[] = new Count($min, $max, $weight); |
40 | 40 | |
41 | - StableSort::usort($this->constraints, static function (Count $a, Count $b): int { |
|
41 | + StableSort::usort($this->constraints, static function(Count $a, Count $b): int { |
|
42 | 42 | return $b->getWeight() <=> $a->getWeight(); |
43 | 43 | }); |
44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function test($password, ?int $weight = 1): bool |
56 | 56 | { |
57 | - $count = $this->getCount((string)$password); |
|
57 | + $count = $this->getCount((string) $password); |
|
58 | 58 | $constraint = $this->getViolation($count, $weight); |
59 | 59 | |
60 | 60 | return $constraint === null; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function validate($password): ?ValidationError |
70 | 70 | { |
71 | - $count = $this->getCount((string)$password); |
|
71 | + $count = $this->getCount((string) $password); |
|
72 | 72 | $constraint = $this->getViolation($count); |
73 | 73 | |
74 | 74 | if ($constraint !== null) { |