Passed
Push — master ( d572ef...85dd85 )
by Smoren
02:17
created
src/Rules/StringRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
     {
85 85
         return $this->check(
86 86
             CheckBuilder::create(CheckName::ENDS_WITH)
87
-                ->withPredicate(static function ($value, string $substr) {
88
-                    return \substr($value, \mb_strlen($value) - \mb_strlen($substr)) === $substr;
87
+                ->withPredicate(static function($value, string $substr) {
88
+                    return \substr($value, \mb_strlen($value)-\mb_strlen($substr)) === $substr;
89 89
                 })
90 90
                 ->withParams(['substring' => $substr])
91 91
                 ->build()
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         return $this->check(
98 98
             CheckBuilder::create(CheckName::LENGTH_IS)
99
-                ->withPredicate(static function ($value) use ($rule) {
99
+                ->withPredicate(static function($value) use ($rule) {
100 100
                     /** @var string $value */
101 101
                     $rule->validate(\mb_strlen($value));
102 102
                     return true;
Please login to merge, or discard this patch.
src/Rules/ContainerRule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         return $this->check(
188 188
             CheckBuilder::create(CheckName::LENGTH_IS)
189
-                ->withPredicate(static function ($value) use ($rule) {
189
+                ->withPredicate(static function($value) use ($rule) {
190 190
                     /** @var \Countable $value */
191 191
                     $rule->validate(\count($value));
192 192
                     return true;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
         return $this->check(
211 211
             CheckBuilder::create(CheckName::ATTRIBUTE_IS)
212
-                ->withPredicate(static function ($value, string $name) use ($rule) {
212
+                ->withPredicate(static function($value, string $name) use ($rule) {
213 213
                     $rule->validate(ContainerAccessHelper::getAttributeValue($value, $name));
214 214
                     return true;
215 215
                 })
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     {
229 229
         return $this->check(
230 230
             CheckBuilder::create(CheckName::HAS_ATTRIBUTE)
231
-                ->withPredicate(static function ($value) use ($name, $rule) {
231
+                ->withPredicate(static function($value) use ($name, $rule) {
232 232
                     if (!ContainerAccessHelper::hasAccessibleAttribute($value, $name)) {
233 233
                         return true;
234 234
                     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     {
250 250
         return $this->check(
251 251
             CheckBuilder::create(CheckName::ALL_KEYS_ARE)
252
-                ->withPredicate(static function ($value) use ($rule) {
252
+                ->withPredicate(static function($value) use ($rule) {
253 253
                     foreach ($value as $k => $v) {
254 254
                         $rule->validate($k);
255 255
                     }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     {
270 270
         return $this->check(
271 271
             CheckBuilder::create(CheckName::ALL_VALUES_ARE)
272
-                ->withPredicate(static function ($value) use ($rule) {
272
+                ->withPredicate(static function($value) use ($rule) {
273 273
                     foreach ($value as $v) {
274 274
                         $rule->validate($v);
275 275
                     }
Please login to merge, or discard this patch.
src/Factories/Value.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      *
101 101
      * @return CompositeRuleInterface
102 102
      */
103
-    public static function anyOf(array $rules, string $name = RuleName::OR): CompositeRuleInterface
103
+    public static function anyOf(array $rules, string $name = RuleName:: OR ): CompositeRuleInterface
104 104
     {
105 105
         return new AnyOfRule($rules, $name);
106 106
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      *
112 112
      * @return CompositeRuleInterface
113 113
      */
114
-    public static function allOf(array $rules, string $name = RuleName::AND): CompositeRuleInterface
114
+    public static function allOf(array $rules, string $name = RuleName:: AND ): CompositeRuleInterface
115 115
     {
116 116
         return new AllOfRule($rules, $name);
117 117
     }
Please login to merge, or discard this patch.
src/Rules/NumericRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     {
268 268
         return $this->check(
269 269
             CheckBuilder::create(CheckName::FRACTIONAL)
270
-                ->withPredicate(fn ($value) => \abs($value - \round(\floatval($value))) >= \PHP_FLOAT_EPSILON)
270
+                ->withPredicate(fn ($value) => \abs($value-\round(\floatval($value))) >= \PHP_FLOAT_EPSILON)
271 271
                 ->build()
272 272
         );
273 273
     }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     {
282 282
         return $this->check(
283 283
             CheckBuilder::create(CheckName::NON_FRACTIONAL)
284
-                ->withPredicate(fn ($value) => \abs($value - \round(\floatval($value))) < \PHP_FLOAT_EPSILON)
284
+                ->withPredicate(fn ($value) => \abs($value-\round(\floatval($value))) < \PHP_FLOAT_EPSILON)
285 285
                 ->build()
286 286
         );
287 287
     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
     {
324 324
         return $this->check(
325 325
             CheckBuilder::create(CheckName::EVEN)
326
-                ->withPredicate(fn ($value) => $value % 2 === 0)
326
+                ->withPredicate(fn ($value) => $value%2 === 0)
327 327
                 ->build()
328 328
         );
329 329
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     {
338 338
         return $this->check(
339 339
             CheckBuilder::create(CheckName::ODD)
340
-                ->withPredicate(fn ($value) => $value % 2 !== 0)
340
+                ->withPredicate(fn ($value) => $value%2 !== 0)
341 341
                 ->build()
342 342
         );
343 343
     }
Please login to merge, or discard this patch.