@@ -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 | } |
@@ -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()); |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | private function getGuessableData($password) |
| 105 | 105 | { |
| 106 | 106 | if ($password instanceof Password) { |
| 107 | - foreach ($this->getWordsToCheck((string)$password) as $word) { |
|
| 107 | + foreach ($this->getWordsToCheck((string) $password) as $word) { |
|
| 108 | 108 | foreach ($password->getGuessableData() as $data) { |
| 109 | 109 | if ($this->contains($word, $data)) { |
| 110 | 110 | return $data; |
@@ -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 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->constraints[] = new Count($min, $max, $weight); |
| 39 | 39 | |
| 40 | - StableSort::usort($this->constraints, function (Count $a, Count $b): int { |
|
| 40 | + StableSort::usort($this->constraints, function(Count $a, Count $b): int { |
|
| 41 | 41 | return $b->getWeight() <=> $a->getWeight(); |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function test($password): bool |
| 54 | 54 | { |
| 55 | - $count = $this->getCount((string)$password); |
|
| 55 | + $count = $this->getCount((string) $password); |
|
| 56 | 56 | $constraint = $this->getViolation($count); |
| 57 | 57 | |
| 58 | 58 | return $constraint === null; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function enforce($password): void |
| 68 | 68 | { |
| 69 | - $count = $this->getCount((string)$password); |
|
| 69 | + $count = $this->getCount((string) $password); |
|
| 70 | 70 | $constraint = $this->getViolation($count); |
| 71 | 71 | |
| 72 | 72 | if ($constraint !== null) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->constraints[] = new Count($min, $max, $weight); |
| 39 | 39 | |
| 40 | - StableSort::usort($this->constraints, function (Count $a, Count $b): int { |
|
| 40 | + StableSort::usort($this->constraints, function(Count $a, Count $b): int { |
|
| 41 | 41 | return $b->getWeight() <=> $a->getWeight(); |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function test($password): bool |
| 54 | 54 | { |
| 55 | - $count = $this->getCount((string)$password); |
|
| 55 | + $count = $this->getCount((string) $password); |
|
| 56 | 56 | $constraint = $this->getViolation($count); |
| 57 | 57 | |
| 58 | 58 | return $constraint === null; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function enforce($password): void |
| 68 | 68 | { |
| 69 | - $count = $this->getCount((string)$password); |
|
| 69 | + $count = $this->getCount((string) $password); |
|
| 70 | 70 | $constraint = $this->getViolation($count); |
| 71 | 71 | |
| 72 | 72 | if ($constraint !== null) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->constraints[] = new Count($min, $max, $weight); |
| 39 | 39 | |
| 40 | - StableSort::usort($this->constraints, function (Count $a, Count $b): int { |
|
| 40 | + StableSort::usort($this->constraints, function(Count $a, Count $b): int { |
|
| 41 | 41 | return $b->getWeight() <=> $a->getWeight(); |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function test($password): bool |
| 54 | 54 | { |
| 55 | - $count = $this->getCount((string)$password); |
|
| 55 | + $count = $this->getCount((string) $password); |
|
| 56 | 56 | $constraint = $this->getViolation($count); |
| 57 | 57 | |
| 58 | 58 | return $constraint === null; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function enforce($password): void |
| 68 | 68 | { |
| 69 | - $count = $this->getCount((string)$password); |
|
| 69 | + $count = $this->getCount((string) $password); |
|
| 70 | 70 | $constraint = $this->getViolation($count); |
| 71 | 71 | |
| 72 | 72 | if ($constraint !== null) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->constraints[] = new Count($min, $max, $weight); |
| 39 | 39 | |
| 40 | - StableSort::usort($this->constraints, function (Count $a, Count $b): int { |
|
| 40 | + StableSort::usort($this->constraints, function(Count $a, Count $b): int { |
|
| 41 | 41 | return $b->getWeight() <=> $a->getWeight(); |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function test($password): bool |
| 54 | 54 | { |
| 55 | - $count = $this->getCount((string)$password); |
|
| 55 | + $count = $this->getCount((string) $password); |
|
| 56 | 56 | $constraint = $this->getViolation($count); |
| 57 | 57 | |
| 58 | 58 | return $constraint === null; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function enforce($password): void |
| 68 | 68 | { |
| 69 | - $count = $this->getCount((string)$password); |
|
| 69 | + $count = $this->getCount((string) $password); |
|
| 70 | 70 | $constraint = $this->getViolation($count); |
| 71 | 71 | |
| 72 | 72 | if ($constraint !== null) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $this->constraints[] = new Count($min, $max, $weight); |
| 54 | 54 | |
| 55 | - StableSort::usort($this->constraints, function (Count $a, Count $b): int { |
|
| 55 | + StableSort::usort($this->constraints, function(Count $a, Count $b): int { |
|
| 56 | 56 | return $b->getWeight() <=> $a->getWeight(); |
| 57 | 57 | }); |
| 58 | 58 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function test($password): bool |
| 107 | 107 | { |
| 108 | - $count = $this->getCount((string)$password); |
|
| 108 | + $count = $this->getCount((string) $password); |
|
| 109 | 109 | $constraint = $this->getViolation($count); |
| 110 | 110 | |
| 111 | 111 | return $constraint === null; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function enforce($password): void |
| 118 | 118 | { |
| 119 | - $count = $this->getCount((string)$password); |
|
| 119 | + $count = $this->getCount((string) $password); |
|
| 120 | 120 | $constraint = $this->getViolation($count); |
| 121 | 121 | |
| 122 | 122 | if ($constraint !== null) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $lines = explode("\r\n", $contents); |
| 163 | 163 | foreach ($lines as $line) { |
| 164 | 164 | if (substr($line, 0, 35) === $suffix) { |
| 165 | - return (int)substr($line, 36); |
|
| 165 | + return (int) substr($line, 36); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | return 0; |