Passed
Push — master ( 2c9f14...bcd12b )
by Magnar Ovedal
06:35
created
src/Rule/UpperCaseRule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $this->constraints[] = new CountConstraint($min, $max, $weight);
41 41
 
42
-        StableSort::usort($this->constraints, static function (CountConstraint $a, CountConstraint $b): int {
42
+        StableSort::usort($this->constraints, static function(CountConstraint $a, CountConstraint $b): int {
43 43
             return $b->getWeight() <=> $a->getWeight();
44 44
         });
45 45
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function test($password, ?int $weight = 1): bool
57 57
     {
58
-        $count = $this->getCount((string)$password);
58
+        $count = $this->getCount((string) $password);
59 59
         $constraint = $this->getViolation($count, $weight);
60 60
 
61 61
         return $constraint === null;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function validate($password, TranslatorInterface $translator): ?ValidationError
72 72
     {
73
-        $count = $this->getCount((string)$password);
73
+        $count = $this->getCount((string) $password);
74 74
         $constraint = $this->getViolation($count);
75 75
 
76 76
         if ($constraint !== null) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         assert(count($passwordCharacters) === count($lowerCaseCharacters));
118 118
 
119 119
         $count = 0;
120
-        for ($i = count($passwordCharacters) - 1; $i >= 0; --$i) {
120
+        for ($i = count($passwordCharacters)-1; $i >= 0; --$i) {
121 121
             if ($passwordCharacters[$i] !== $lowerCaseCharacters[$i]) {
122 122
                 ++$count;
123 123
             }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         if ($constraint->getMax() === null) {
150 150
             return $translator->trans(
151
-                'The password must contain at least one upper case letter.|' .
151
+                'The password must contain at least one upper case letter.|'.
152 152
                 'The password must contain at least %count% upper case letters.',
153 153
                 ['%count%' => $constraint->getMin()]
154 154
             );
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         if ($constraint->getMin() === 0) {
164 164
             return $translator->trans(
165
-                'The password must contain at most one upper case letter.|' .
165
+                'The password must contain at most one upper case letter.|'.
166 166
                 'The password must contain at most %count% upper case letters.',
167 167
                 ['%count%' => $constraint->getMax()]
168 168
             );
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         if ($constraint->getMin() === $constraint->getMax()) {
172 172
             return $translator->trans(
173
-                'The password must contain exactly one upper case letter.|' .
173
+                'The password must contain exactly one upper case letter.|'.
174 174
                 'The password must contain exactly %count% upper case letters.',
175 175
                 ['%count%' => $constraint->getMin()]
176 176
             );
Please login to merge, or discard this patch.