Completed
Push — master ( de4379...69572d )
by Neomerx
09:55
created
src/Rules/Comparisons/ScalarInValues.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function __construct(array $scalars)
32 32
     {
33
-        assert(call_user_func(function () use ($scalars) {
33
+        assert(call_user_func(function() use ($scalars) {
34 34
             foreach ($scalars as $scalar) {
35 35
                 assert(static::isValidType($scalar) === true);
36 36
             }
Please login to merge, or discard this patch.
sample/main.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php namespace Sample;
2 2
 
3
-require_once __DIR__ . '/vendor/autoload.php';
3
+require_once __DIR__.'/vendor/autoload.php';
4 4
 
5 5
 /**
6 6
  * Copyright 2015-2017 [email protected]
Please login to merge, or discard this patch.
src/Validator/Comparisons.php 1 patch
Spacing   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -105,8 +105,7 @@  discard block
 block discarded – undo
105 105
     protected static function lessThan($value, RuleInterface $next = null): RuleInterface
106 106
     {
107 107
         return $next === null ?
108
-            $value instanceof DateTimeInterface ? new DateTimeLessThan($value) : new NumericLessThan($value) :
109
-            new AndOperator(static::lessThan($value), $next);
108
+            $value instanceof DateTimeInterface ? new DateTimeLessThan($value) : new NumericLessThan($value) : new AndOperator(static::lessThan($value), $next);
110 109
     }
111 110
 
112 111
     /**
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
     protected static function lessOrEquals($value, RuleInterface $next = null): RuleInterface
119 118
     {
120 119
         return $next === null ?
121
-            $value instanceof DateTimeInterface ? new DateTimeLessOrEquals($value) : new NumericLessOrEquals($value) :
122
-            new AndOperator(static::lessOrEquals($value), $next);
120
+            $value instanceof DateTimeInterface ? new DateTimeLessOrEquals($value) : new NumericLessOrEquals($value) : new AndOperator(static::lessOrEquals($value), $next);
123 121
     }
124 122
 
125 123
     /**
@@ -131,8 +129,7 @@  discard block
 block discarded – undo
131 129
     protected static function moreThan($value, RuleInterface $next = null): RuleInterface
132 130
     {
133 131
         return $next === null ?
134
-            $value instanceof DateTimeInterface ? new DateTimeMoreThan($value) : new NumericMoreThan($value) :
135
-            new AndOperator(static::moreThan($value), $next);
132
+            $value instanceof DateTimeInterface ? new DateTimeMoreThan($value) : new NumericMoreThan($value) : new AndOperator(static::moreThan($value), $next);
136 133
     }
137 134
 
138 135
     /**
@@ -145,8 +142,7 @@  discard block
 block discarded – undo
145 142
     {
146 143
         return $next === null ?
147 144
             ($value instanceof DateTimeInterface ?
148
-                new DateTimeMoreOrEquals($value) : new NumericMoreOrEqualsThan($value)) :
149
-            new AndOperator(static::moreOrEquals($value), $next);
145
+                new DateTimeMoreOrEquals($value) : new NumericMoreOrEqualsThan($value)) : new AndOperator(static::moreOrEquals($value), $next);
150 146
     }
151 147
 
152 148
     /**
@@ -162,8 +158,7 @@  discard block
 block discarded – undo
162 158
 
163 159
         return $next === null ?
164 160
             ($areLimitsDates ?
165
-                new DateTimeBetween($lowerLimit, $upperLimit) : new NumericBetween($lowerLimit, $upperLimit)) :
166
-            new AndOperator(static::between($lowerLimit, $upperLimit), $next);
161
+                new DateTimeBetween($lowerLimit, $upperLimit) : new NumericBetween($lowerLimit, $upperLimit)) : new AndOperator(static::between($lowerLimit, $upperLimit), $next);
167 162
     }
168 163
 
169 164
     /**
@@ -176,8 +171,7 @@  discard block
 block discarded – undo
176 171
     protected static function stringLengthBetween(int $min, int $max, RuleInterface $next = null): RuleInterface
177 172
     {
178 173
         return $next === null ?
179
-            new StringLengthBetween($min, $max) :
180
-            new AndOperator(static::stringLengthBetween($min, $max), $next);
174
+            new StringLengthBetween($min, $max) : new AndOperator(static::stringLengthBetween($min, $max), $next);
181 175
     }
182 176
 
183 177
     /**
@@ -189,8 +183,7 @@  discard block
 block discarded – undo
189 183
     protected static function stringLengthMin(int $min, RuleInterface $next = null): RuleInterface
190 184
     {
191 185
         return $next === null ?
192
-            new StringLengthMin($min) :
193
-            new AndOperator(static::stringLengthMin($min), $next);
186
+            new StringLengthMin($min) : new AndOperator(static::stringLengthMin($min), $next);
194 187
     }
195 188
 
196 189
     /**
@@ -202,8 +195,7 @@  discard block
 block discarded – undo
202 195
     protected static function stringLengthMax(int $max, RuleInterface $next = null): RuleInterface
203 196
     {
204 197
         return $next === null ?
205
-            new StringLengthMax($max) :
206
-            new AndOperator(static::stringLengthMax($max), $next);
198
+            new StringLengthMax($max) : new AndOperator(static::stringLengthMax($max), $next);
207 199
     }
208 200
 
209 201
     /**
@@ -215,8 +207,7 @@  discard block
 block discarded – undo
215 207
     protected static function regexp(string $pattern, RuleInterface $next = null): RuleInterface
216 208
     {
217 209
         return $next === null ?
218
-            new StringRegExp($pattern) :
219
-            new AndOperator(static::regexp($pattern), $next);
210
+            new StringRegExp($pattern) : new AndOperator(static::regexp($pattern), $next);
220 211
     }
221 212
 
222 213
     /**
Please login to merge, or discard this patch.
src/Rules/Types/AsArray.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_array($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_ARRAY);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_ARRAY);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.
src/Rules/Types/AsNumeric.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_numeric($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_NUMERIC);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_NUMERIC);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.
src/Rules/Types/AsFloat.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_float($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_FLOAT);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_FLOAT);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.
src/Rules/Types/AsBool.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_bool($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_BOOL);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_BOOL);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.
src/Rules/Types/AsInt.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_int($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_INT);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_INT);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.
src/Rules/Types/AsString.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         return is_string($value) === true ?
39
-            static::createSuccessReply($value) :
40
-            static::createErrorReply($context, $value, ErrorCodes::IS_STRING);
39
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::IS_STRING);
41 40
     }
42 41
 }
Please login to merge, or discard this patch.