@@ -80,7 +80,7 @@ |
||
80 | 80 | { |
81 | 81 | $this->formerPasswords = array_merge($this->formerPasswords, $formerPasswords); |
82 | 82 | |
83 | - StableSort::usort($this->formerPasswords, function (FormerPassword $a, FormerPassword $b): int { |
|
83 | + StableSort::usort($this->formerPasswords, function(FormerPassword $a, FormerPassword $b): int { |
|
84 | 84 | return $b->getDate() <=> $a->getDate(); |
85 | 85 | }); |
86 | 86 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function test($password): bool |
66 | 66 | { |
67 | - $count = $this->getNoncompliantCount((string)$password); |
|
67 | + $count = $this->getNoncompliantCount((string) $password); |
|
68 | 68 | |
69 | 69 | return $count === null; |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function enforce($password): void |
79 | 79 | { |
80 | - $count = $this->getNoncompliantCount((string)$password); |
|
80 | + $count = $this->getNoncompliantCount((string) $password); |
|
81 | 81 | |
82 | 82 | if ($count !== null) { |
83 | 83 | throw new RuleException($this, $this->getMessage()); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function test($password): bool |
76 | 76 | { |
77 | - $word = $this->getDictionaryWord((string)$password); |
|
77 | + $word = $this->getDictionaryWord((string) $password); |
|
78 | 78 | |
79 | 79 | return $word === null; |
80 | 80 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function enforce($password): void |
86 | 86 | { |
87 | - $word = $this->getDictionaryWord((string)$password); |
|
87 | + $word = $this->getDictionaryWord((string) $password); |
|
88 | 88 | |
89 | 89 | if ($word !== null) { |
90 | 90 | throw new RuleException($this, $this->getMessage()); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | for ($i = $start; $i < $end; ++$i) { |
116 | - if ($this->hashFunction->compare((string)$password, (string)$formerPasswords[$i])) { |
|
116 | + if ($this->hashFunction->compare((string) $password, (string) $formerPasswords[$i])) { |
|
117 | 117 | return $formerPasswords[$i]; |
118 | 118 | } |
119 | 119 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function test($password): bool |
119 | 119 | { |
120 | - $count = $this->getNoncompliantCount((string)$password); |
|
120 | + $count = $this->getNoncompliantCount((string) $password); |
|
121 | 121 | |
122 | 122 | return $count === null; |
123 | 123 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function enforce($password): void |
129 | 129 | { |
130 | - $count = $this->getNoncompliantCount((string)$password); |
|
130 | + $count = $this->getNoncompliantCount((string) $password); |
|
131 | 131 | |
132 | 132 | if ($count !== null) { |
133 | 133 | throw new RuleException($this, $this->getMessage()); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $lines = explode("\r\n", $contents); |
178 | 178 | foreach ($lines as $line) { |
179 | 179 | if (substr($line, 0, 35) === $suffix) { |
180 | - return (int)substr($line, 36); |
|
180 | + return (int) substr($line, 36); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | return 0; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function test($password): bool |
66 | 66 | { |
67 | - $count = $this->getNoncompliantCount((string)$password); |
|
67 | + $count = $this->getNoncompliantCount((string) $password); |
|
68 | 68 | |
69 | 69 | return $count === null; |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function enforce($password): void |
79 | 79 | { |
80 | - $count = $this->getNoncompliantCount((string)$password); |
|
80 | + $count = $this->getNoncompliantCount((string) $password); |
|
81 | 81 | |
82 | 82 | if ($count !== null) { |
83 | 83 | throw new RuleException($this, $this->getMessage()); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function test($password): bool |
66 | 66 | { |
67 | - $count = $this->getNoncompliantCount((string)$password); |
|
67 | + $count = $this->getNoncompliantCount((string) $password); |
|
68 | 68 | |
69 | 69 | return $count === null; |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function enforce($password): void |
79 | 79 | { |
80 | - $count = $this->getNoncompliantCount((string)$password); |
|
80 | + $count = $this->getNoncompliantCount((string) $password); |
|
81 | 81 | |
82 | 82 | if ($count !== null) { |
83 | 83 | throw new RuleException($this, $this->getMessage()); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function test($password): bool |
66 | 66 | { |
67 | - $count = $this->getNoncompliantCount((string)$password); |
|
67 | + $count = $this->getNoncompliantCount((string) $password); |
|
68 | 68 | |
69 | 69 | return $count === null; |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function enforce($password): void |
79 | 79 | { |
80 | - $count = $this->getNoncompliantCount((string)$password); |
|
80 | + $count = $this->getNoncompliantCount((string) $password); |
|
81 | 81 | |
82 | 82 | if ($count !== null) { |
83 | 83 | throw new RuleException($this, $this->getMessage()); |
@@ -61,14 +61,14 @@ |
||
61 | 61 | |
62 | 62 | $decodeMap = []; |
63 | 63 | foreach ($this->decodeMap as $encodedChar => $chars) { |
64 | - if ((string)$encodedChar === mb_substr($word, 0, mb_strlen((string)$encodedChar))) { |
|
64 | + if ((string) $encodedChar === mb_substr($word, 0, mb_strlen((string) $encodedChar))) { |
|
65 | 65 | $decodeMap[$encodedChar] = $chars; |
66 | 66 | } |
67 | 67 | } |
68 | 68 | $decodeMap[mb_substr($word, 0, 1)][] = mb_substr($word, 0, 1); |
69 | 69 | |
70 | 70 | foreach ($decodeMap as $encodedChar => $chars) { |
71 | - foreach ($this->convert(mb_substr($word, mb_strlen((string)$encodedChar))) as $suffix) { |
|
71 | + foreach ($this->convert(mb_substr($word, mb_strlen((string) $encodedChar))) as $suffix) { |
|
72 | 72 | foreach ($chars as $char) { |
73 | 73 | yield $char.$suffix; |
74 | 74 | } |