@@ -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 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
| 40 | 40 | |
| 41 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
| 41 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $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) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
| 40 | 40 | |
| 41 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
| 41 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $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) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
| 40 | 40 | |
| 41 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
| 41 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $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 PositionConstraint($first, $count, $weight); |
| 48 | 48 | |
| 49 | - StableSort::usort($this->constraints, static function (PositionConstraint $a, PositionConstraint $b): int { |
|
| 49 | + StableSort::usort($this->constraints, static function(PositionConstraint $a, PositionConstraint $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; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $decodeMap = []; |
| 60 | 60 | foreach ($this->decodeMap as $encodedChar => $chars) { |
| 61 | - if ((string)$encodedChar === mb_substr($word, 0, mb_strlen((string)$encodedChar))) { |
|
| 61 | + if ((string) $encodedChar === mb_substr($word, 0, mb_strlen((string) $encodedChar))) { |
|
| 62 | 62 | $decodeMap[$encodedChar] = $chars; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | foreach ($this->getDecodeMap($word) as $encodedChar => $chars) { |
| 92 | - foreach ($this->formatWord(mb_substr($word, mb_strlen((string)$encodedChar))) as $suffix) { |
|
| 92 | + foreach ($this->formatWord(mb_substr($word, mb_strlen((string) $encodedChar))) as $suffix) { |
|
| 93 | 93 | foreach ($chars as $char) { |
| 94 | 94 | yield $char.$suffix; |
| 95 | 95 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | $this->constraints[] = new DateConstraint($min, $max, $weight); |
| 42 | 42 | |
| 43 | - StableSort::usort($this->constraints, static function (DateConstraint $a, DateConstraint $b): int { |
|
| 43 | + StableSort::usort($this->constraints, static function(DateConstraint $a, DateConstraint $b): int { |
|
| 44 | 44 | return $b->getWeight() <=> $a->getWeight(); |
| 45 | 45 | }); |
| 46 | 46 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $this->constraints[] = new DateIntervalConstraint($min, $max, $weight); |
| 44 | 44 | |
| 45 | - StableSort::usort($this->constraints, static function ( |
|
| 45 | + StableSort::usort($this->constraints, static function( |
|
| 46 | 46 | DateIntervalConstraint $a, |
| 47 | 47 | DateIntervalConstraint $b |
| 48 | 48 | ): int { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
| 40 | 40 | |
| 41 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
| 41 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $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) { |