@@ -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) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
51 | 51 | |
52 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
52 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $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 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) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $this->constraints[] = new CountConstraint($min, $max, $weight); |
55 | 55 | |
56 | - StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int { |
|
56 | + StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $b): int { |
|
57 | 57 | return $b->getWeight() <=> $a->getWeight(); |
58 | 58 | }); |
59 | 59 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function test($password, ?int $weight = 1): bool |
108 | 108 | { |
109 | - $count = $this->getCount((string)$password); |
|
109 | + $count = $this->getCount((string) $password); |
|
110 | 110 | $constraint = $this->getViolation($count, $weight); |
111 | 111 | |
112 | 112 | return $constraint === null; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function validate($password): ?ValidationError |
119 | 119 | { |
120 | - $count = $this->getCount((string)$password); |
|
120 | + $count = $this->getCount((string) $password); |
|
121 | 121 | $constraint = $this->getViolation($count); |
122 | 122 | |
123 | 123 | if ($constraint !== null) { |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $lines = explode("\r\n", $contents); |
175 | 175 | foreach ($lines as $line) { |
176 | 176 | if (substr($line, 0, 35) === $suffix) { |
177 | - return (int)substr($line, 36); |
|
177 | + return (int) substr($line, 36); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | return 0; |