Passed
Pull Request — master (#736)
by Abdul Malik
06:39
created
src/Validation/src/Checker/DatetimeChecker.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function format($value, string $format): bool
84 84
     {
85
-        if (!$this->isApplicableValue($value)) {
85
+        if (!$this->isApplicableValue($value)){
86 86
             return false;
87 87
         }
88 88
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function timezone($value): bool
112 112
     {
113
-        if (!is_scalar($value)) {
113
+        if (!is_scalar($value)){
114 114
             return false;
115 115
         }
116 116
 
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function now(): ?\DateTimeInterface
152 152
     {
153
-        try {
153
+        try{
154 154
             return $this->date($this->now ?: 'now');
155
-        } catch (\Throwable $e) {
155
+        }catch (\Throwable $e){
156 156
             //here's the fail;
157 157
         }
158 158
 
@@ -165,25 +165,25 @@  discard block
 block discarded – undo
165 165
      */
166 166
     private function date($value): ?\DateTimeInterface
167 167
     {
168
-        if (is_callable($value)) {
168
+        if (is_callable($value)){
169 169
             $value = $value();
170 170
         }
171 171
 
172
-        if ($value instanceof \DateTimeInterface) {
172
+        if ($value instanceof \DateTimeInterface){
173 173
             return $value;
174 174
         }
175 175
 
176
-        if (!$this->isApplicableValue($value)) {
176
+        if (!$this->isApplicableValue($value)){
177 177
             return null;
178 178
         }
179 179
 
180
-        try {
181
-            if (!$value) {
180
+        try{
181
+            if (!$value){
182 182
                 $value = '0';
183 183
             }
184 184
 
185 185
             return new \DateTimeImmutable(is_numeric($value) ? sprintf('@%d', $value) : trim($value));
186
-        } catch (\Throwable $e) {
186
+        }catch (\Throwable $e){
187 187
             //here's the fail;
188 188
         }
189 189
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     private function fromField(string $field): ?\DateTimeInterface
207 207
     {
208 208
         $before = $this->getValidator()->getValue($field);
209
-        if ($before !== null) {
209
+        if ($before !== null){
210 210
             return $this->date($before);
211 211
         }
212 212
 
Please login to merge, or discard this patch.
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -82,7 +82,8 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function format($value, string $format): bool
84 84
     {
85
-        if (!$this->isApplicableValue($value)) {
85
+        if (!$this->isApplicableValue($value))
86
+        {
86 87
             return false;
87 88
         }
88 89
 
@@ -110,7 +111,8 @@  discard block
 block discarded – undo
110 111
      */
111 112
     public function timezone($value): bool
112 113
     {
113
-        if (!is_scalar($value)) {
114
+        if (!is_scalar($value))
115
+        {
114 116
             return false;
115 117
         }
116 118
 
@@ -150,9 +152,12 @@  discard block
 block discarded – undo
150 152
      */
151 153
     private function now(): ?\DateTimeInterface
152 154
     {
153
-        try {
155
+        try
156
+        {
154 157
             return $this->date($this->now ?: 'now');
155
-        } catch (\Throwable $e) {
158
+        }
159
+        catch (\Throwable $e)
160
+        {
156 161
             //here's the fail;
157 162
         }
158 163
 
@@ -165,25 +170,32 @@  discard block
 block discarded – undo
165 170
      */
166 171
     private function date($value): ?\DateTimeInterface
167 172
     {
168
-        if (is_callable($value)) {
173
+        if (is_callable($value))
174
+        {
169 175
             $value = $value();
170 176
         }
171 177
 
172
-        if ($value instanceof \DateTimeInterface) {
178
+        if ($value instanceof \DateTimeInterface)
179
+        {
173 180
             return $value;
174 181
         }
175 182
 
176
-        if (!$this->isApplicableValue($value)) {
183
+        if (!$this->isApplicableValue($value))
184
+        {
177 185
             return null;
178 186
         }
179 187
 
180
-        try {
181
-            if (!$value) {
188
+        try
189
+        {
190
+            if (!$value)
191
+            {
182 192
                 $value = '0';
183 193
             }
184 194
 
185 195
             return new \DateTimeImmutable(is_numeric($value) ? sprintf('@%d', $value) : trim($value));
186
-        } catch (\Throwable $e) {
196
+        }
197
+        catch (\Throwable $e)
198
+        {
187 199
             //here's the fail;
188 200
         }
189 201
 
@@ -206,7 +218,8 @@  discard block
 block discarded – undo
206 218
     private function fromField(string $field): ?\DateTimeInterface
207 219
     {
208 220
         $before = $this->getValidator()->getValue($field);
209
-        if ($before !== null) {
221
+        if ($before !== null)
222
+        {
210 223
             return $this->date($before);
211 224
         }
212 225
 
Please login to merge, or discard this patch.
src/Validation/tests/Checkers/DatetimeTest.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             [true, $callableNow, $now, true, true]
45 45
         ];
46 46
 
47
-        $callableFutureTime = static function () {
47
+        $callableFutureTime = static function (){
48 48
             return time() + 1000;
49 49
         };
50 50
         yield from [
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             [false, $callableFutureTime, $now, true, true],
53 53
         ];
54 54
 
55
-        $callablePastTime = static function () {
55
+        $callablePastTime = static function (){
56 56
             return time() - 1000;
57 57
         };
58 58
         yield from [
@@ -231,24 +231,24 @@  discard block
 block discarded – undo
231 231
     public function validProvider(): array
232 232
     {
233 233
         return [
234
-            [true, time() - 1000,],
235
-            [true, time(),],
236
-            [true, date('u'),],
237
-            [true, time() + 1000,],
238
-            [true, '',],
239
-            [true, 'tomorrow +2hours',],
240
-            [true, 'yesterday -2hours',],
241
-            [true, 'now',],
242
-            [true, 'now + 1000 seconds',],
243
-            [true, 'now - 1000 seconds',],
244
-            [true, 0,],
245
-            [true, 1.1,],
246
-            [false, [],],
247
-            [false, false,],
248
-            [false, true,],
249
-            [false, null,],
250
-            [false, [],],
251
-            [false, new \stdClass(),],
234
+            [true, time() - 1000, ],
235
+            [true, time(), ],
236
+            [true, date('u'), ],
237
+            [true, time() + 1000, ],
238
+            [true, '', ],
239
+            [true, 'tomorrow +2hours', ],
240
+            [true, 'yesterday -2hours', ],
241
+            [true, 'now', ],
242
+            [true, 'now + 1000 seconds', ],
243
+            [true, 'now - 1000 seconds', ],
244
+            [true, 0, ],
245
+            [true, 1.1, ],
246
+            [false, [], ],
247
+            [false, false, ],
248
+            [false, true, ],
249
+            [false, null, ],
250
+            [false, [], ],
251
+            [false, new \stdClass(), ],
252 252
         ];
253 253
     }
254 254
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     {
257 257
         $checker = new DatetimeChecker();
258 258
 
259
-        foreach (\DateTimeZone::listIdentifiers() as $identifier) {
259
+        foreach (\DateTimeZone::listIdentifiers() as $identifier){
260 260
             $this->assertTrue($checker->timezone($identifier));
261 261
             $this->assertFalse($checker->timezone(str_rot13($identifier)));
262 262
         }
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
     private function now(): \Closure
399 399
     {
400
-        return static function () {
400
+        return static function (){
401 401
             return \time();
402 402
         };
403 403
     }
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,8 @@  discard block
 block discarded – undo
35 35
     public function nowProvider(): iterable
36 36
     {
37 37
         $now = new \DateTime();
38
-        $callableNow = static function () use ($now) {
38
+        $callableNow = static function () use ($now)
39
+        {
39 40
             return $now;
40 41
         };
41 42
 
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
             [true, $callableNow, $now, true, true]
45 46
         ];
46 47
 
47
-        $callableFutureTime = static function () {
48
+        $callableFutureTime = static function ()
49
+        {
48 50
             return time() + 1000;
49 51
         };
50 52
         yield from [
@@ -52,7 +54,8 @@  discard block
 block discarded – undo
52 54
             [false, $callableFutureTime, $now, true, true],
53 55
         ];
54 56
 
55
-        $callablePastTime = static function () {
57
+        $callablePastTime = static function ()
58
+        {
56 59
             return time() - 1000;
57 60
         };
58 61
         yield from [
@@ -256,7 +259,8 @@  discard block
 block discarded – undo
256 259
     {
257 260
         $checker = new DatetimeChecker();
258 261
 
259
-        foreach (\DateTimeZone::listIdentifiers() as $identifier) {
262
+        foreach (\DateTimeZone::listIdentifiers() as $identifier)
263
+        {
260 264
             $this->assertTrue($checker->timezone($identifier));
261 265
             $this->assertFalse($checker->timezone(str_rot13($identifier)));
262 266
         }
@@ -397,21 +401,24 @@  discard block
 block discarded – undo
397 401
 
398 402
     private function now(): \Closure
399 403
     {
400
-        return static function () {
404
+        return static function ()
405
+        {
401 406
             return \time();
402 407
         };
403 408
     }
404 409
 
405 410
     private function inFuture(int $seconds): \Closure
406 411
     {
407
-        return static function () use ($seconds) {
412
+        return static function () use ($seconds)
413
+        {
408 414
             return \time() + $seconds;
409 415
         };
410 416
     }
411 417
 
412 418
     private function inPast(int $seconds): \Closure
413 419
     {
414
-        return static function () use ($seconds) {
420
+        return static function () use ($seconds)
421
+        {
415 422
             return \time() - $seconds;
416 423
         };
417 424
     }
Please login to merge, or discard this patch.
src/Framework/Domain/PipelineInterceptor.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
     public function process(string $controller, string $action, array $parameters, CoreInterface $core)
45 45
     {
46 46
         $annotation = $this->readAnnotation($controller, $action);
47
-        if ($core instanceof InterceptorPipeline && $annotation->skipNext) {
47
+        if ($core instanceof InterceptorPipeline && $annotation->skipNext){
48 48
             $this->removeNextInterceptorsFromOriginalPipeline($core);
49 49
         }
50 50
 
51 51
         $pipeline = $this->getCachedPipeline($controller, $action, $annotation);
52
-        if (!empty($pipeline)) {
53
-            if ($core instanceof InterceptorPipeline) {
52
+        if (!empty($pipeline)){
53
+            if ($core instanceof InterceptorPipeline){
54 54
                 $this->injectInterceptorsIntoOriginalPipeline($core, $pipeline);
55
-            } else {
55
+            }else{
56 56
                 $core = new InterceptableCore($core);
57
-                foreach ($pipeline as $interceptor) {
57
+                foreach ($pipeline as $interceptor){
58 58
                     $core->addInterceptor($interceptor);
59 59
                 }
60 60
             }
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      */
71 71
     private function readAnnotation(string $controller, string $action): Pipeline
72 72
     {
73
-        try {
73
+        try{
74 74
             $method = new \ReflectionMethod($controller, $action);
75
-        } catch (\ReflectionException $e) {
75
+        }catch (\ReflectionException $e){
76 76
             return new Pipeline();
77 77
         }
78 78
 
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 
92 92
         $oldInterceptors = $pipelineReflection->getValue($pipeline);
93 93
         $newInterceptors = [];
94
-        foreach ($oldInterceptors as $interceptor) {
94
+        foreach ($oldInterceptors as $interceptor){
95 95
             $newInterceptors[] = $interceptor;
96
-            if ($interceptor instanceof self) {
96
+            if ($interceptor instanceof self){
97 97
                 break;
98 98
             }
99 99
         }
100 100
 
101
-        if (count($newInterceptors) !== count($oldInterceptors)) {
101
+        if (count($newInterceptors) !== count($oldInterceptors)){
102 102
             $pipelineReflection->setValue($pipeline, $newInterceptors);
103 103
         }
104 104
         $pipelineReflection->setAccessible(false);
@@ -111,16 +111,16 @@  discard block
 block discarded – undo
111 111
 
112 112
         $oldInterceptors = $pipelineReflection->getValue($pipeline);
113 113
         $newInterceptors = [];
114
-        foreach ($oldInterceptors as $interceptor) {
114
+        foreach ($oldInterceptors as $interceptor){
115 115
             $newInterceptors[] = $interceptor;
116
-            if ($interceptor instanceof self) {
117
-                foreach ($interceptors as $newInterceptor) {
116
+            if ($interceptor instanceof self){
117
+                foreach ($interceptors as $newInterceptor){
118 118
                     $newInterceptors[] = $newInterceptor;
119 119
                 }
120 120
             }
121 121
         }
122 122
 
123
-        if (count($newInterceptors) !== count($oldInterceptors)) {
123
+        if (count($newInterceptors) !== count($oldInterceptors)){
124 124
             $pipelineReflection->setValue($pipeline, $newInterceptors);
125 125
         }
126 126
         $pipelineReflection->setAccessible(false);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     private function getCachedPipeline(string $controller, string $action, Pipeline $annotation): array
136 136
     {
137 137
         $key = "{$controller}:{$action}";
138
-        if (!array_key_exists($key, $this->cache)) {
138
+        if (!array_key_exists($key, $this->cache)){
139 139
             $this->cache[$key] = $this->extractAnnotationPipeline($annotation);
140 140
         }
141 141
 
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
     private function extractAnnotationPipeline(Pipeline $annotation): array
150 150
     {
151 151
         $interceptors = [];
152
-        foreach ($annotation->pipeline as $interceptor) {
153
-            try {
152
+        foreach ($annotation->pipeline as $interceptor){
153
+            try{
154 154
                 $interceptors[] = $this->container->get($interceptor);
155
-            } catch (\Throwable $e) {
155
+            }catch (\Throwable $e){
156 156
             }
157 157
         }
158 158
 
Please login to merge, or discard this patch.
Braces   +39 added lines, -18 removed lines patch added patch discarded remove patch
@@ -44,17 +44,23 @@  discard block
 block discarded – undo
44 44
     public function process(string $controller, string $action, array $parameters, CoreInterface $core)
45 45
     {
46 46
         $annotation = $this->readAnnotation($controller, $action);
47
-        if ($core instanceof InterceptorPipeline && $annotation->skipNext) {
47
+        if ($core instanceof InterceptorPipeline && $annotation->skipNext)
48
+        {
48 49
             $this->removeNextInterceptorsFromOriginalPipeline($core);
49 50
         }
50 51
 
51 52
         $pipeline = $this->getCachedPipeline($controller, $action, $annotation);
52
-        if (!empty($pipeline)) {
53
-            if ($core instanceof InterceptorPipeline) {
53
+        if (!empty($pipeline))
54
+        {
55
+            if ($core instanceof InterceptorPipeline)
56
+            {
54 57
                 $this->injectInterceptorsIntoOriginalPipeline($core, $pipeline);
55
-            } else {
58
+            }
59
+            else
60
+            {
56 61
                 $core = new InterceptableCore($core);
57
-                foreach ($pipeline as $interceptor) {
62
+                foreach ($pipeline as $interceptor)
63
+                {
58 64
                     $core->addInterceptor($interceptor);
59 65
                 }
60 66
             }
@@ -70,9 +76,12 @@  discard block
 block discarded – undo
70 76
      */
71 77
     private function readAnnotation(string $controller, string $action): Pipeline
72 78
     {
73
-        try {
79
+        try
80
+        {
74 81
             $method = new \ReflectionMethod($controller, $action);
75
-        } catch (\ReflectionException $e) {
82
+        }
83
+        catch (\ReflectionException $e)
84
+        {
76 85
             return new Pipeline();
77 86
         }
78 87
 
@@ -91,14 +100,17 @@  discard block
 block discarded – undo
91 100
 
92 101
         $oldInterceptors = $pipelineReflection->getValue($pipeline);
93 102
         $newInterceptors = [];
94
-        foreach ($oldInterceptors as $interceptor) {
103
+        foreach ($oldInterceptors as $interceptor)
104
+        {
95 105
             $newInterceptors[] = $interceptor;
96
-            if ($interceptor instanceof self) {
106
+            if ($interceptor instanceof self)
107
+            {
97 108
                 break;
98 109
             }
99 110
         }
100 111
 
101
-        if (count($newInterceptors) !== count($oldInterceptors)) {
112
+        if (count($newInterceptors) !== count($oldInterceptors))
113
+        {
102 114
             $pipelineReflection->setValue($pipeline, $newInterceptors);
103 115
         }
104 116
         $pipelineReflection->setAccessible(false);
@@ -111,16 +123,20 @@  discard block
 block discarded – undo
111 123
 
112 124
         $oldInterceptors = $pipelineReflection->getValue($pipeline);
113 125
         $newInterceptors = [];
114
-        foreach ($oldInterceptors as $interceptor) {
126
+        foreach ($oldInterceptors as $interceptor)
127
+        {
115 128
             $newInterceptors[] = $interceptor;
116
-            if ($interceptor instanceof self) {
117
-                foreach ($interceptors as $newInterceptor) {
129
+            if ($interceptor instanceof self)
130
+            {
131
+                foreach ($interceptors as $newInterceptor)
132
+                {
118 133
                     $newInterceptors[] = $newInterceptor;
119 134
                 }
120 135
             }
121 136
         }
122 137
 
123
-        if (count($newInterceptors) !== count($oldInterceptors)) {
138
+        if (count($newInterceptors) !== count($oldInterceptors))
139
+        {
124 140
             $pipelineReflection->setValue($pipeline, $newInterceptors);
125 141
         }
126 142
         $pipelineReflection->setAccessible(false);
@@ -135,7 +151,8 @@  discard block
 block discarded – undo
135 151
     private function getCachedPipeline(string $controller, string $action, Pipeline $annotation): array
136 152
     {
137 153
         $key = "{$controller}:{$action}";
138
-        if (!array_key_exists($key, $this->cache)) {
154
+        if (!array_key_exists($key, $this->cache))
155
+        {
139 156
             $this->cache[$key] = $this->extractAnnotationPipeline($annotation);
140 157
         }
141 158
 
@@ -149,10 +166,14 @@  discard block
 block discarded – undo
149 166
     private function extractAnnotationPipeline(Pipeline $annotation): array
150 167
     {
151 168
         $interceptors = [];
152
-        foreach ($annotation->pipeline as $interceptor) {
153
-            try {
169
+        foreach ($annotation->pipeline as $interceptor)
170
+        {
171
+            try
172
+            {
154 173
                 $interceptors[] = $this->container->get($interceptor);
155
-            } catch (\Throwable $e) {
174
+            }
175
+            catch (\Throwable $e)
176
+            {
156 177
             }
157 178
         }
158 179
 
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Bootloader/GridBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@
 block discarded – undo
66 66
      */
67 67
     public function compiler(ContainerInterface $container, Compiler $compiler, GridConfig $config): Compiler
68 68
     {
69
-        if ($container->has(DatabaseInterface::class)) {
70
-            foreach ($config->getWriters() as $writer) {
69
+        if ($container->has(DatabaseInterface::class)){
70
+            foreach ($config->getWriters() as $writer){
71 71
                 $compiler->addWriter($container->get($writer));
72 72
             }
73 73
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,10 @@
 block discarded – undo
66 66
      */
67 67
     public function compiler(ContainerInterface $container, Compiler $compiler, GridConfig $config): Compiler
68 68
     {
69
-        if ($container->has(DatabaseInterface::class)) {
70
-            foreach ($config->getWriters() as $writer) {
69
+        if ($container->has(DatabaseInterface::class))
70
+        {
71
+            foreach ($config->getWriters() as $writer)
72
+            {
71 73
                 $compiler->addWriter($container->get($writer));
72 74
             }
73 75
         }
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Writer/BetweenWriter.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,20 +35,20 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
37 37
     {
38
-        if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween) {
38
+        if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween){
39 39
             $filters = $specification->getFilters($this->asOriginal);
40
-            if (count($filters) > 1) {
40
+            if (count($filters) > 1){
41 41
                 return $source->where(static function () use ($compiler, $source, $filters): void {
42 42
                     $compiler->compile($source, ...$filters);
43 43
                 });
44 44
             }
45 45
         }
46 46
 
47
-        if ($specification instanceof Filter\InjectionFilter) {
47
+        if ($specification instanceof Filter\InjectionFilter){
48 48
             $expression = $specification->getFilter();
49
-            if ($expression instanceof Filter\Between) {
49
+            if ($expression instanceof Filter\Between){
50 50
                 $filters = $expression->getFilters($this->asOriginal);
51
-                if (count($filters) > 1) {
51
+                if (count($filters) > 1){
52 52
                     $filters = array_map(
53 53
                         static function (SpecificationInterface $filter) use ($specification): Filter\InjectionFilter {
54 54
                             return Filter\InjectionFilter::createFrom($specification, $filter);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             }
72 72
         }
73 73
 
74
-        if ($specification instanceof Filter\Between) {
74
+        if ($specification instanceof Filter\Between){
75 75
             return $source->where(
76 76
                 $specification->getExpression(),
77 77
                 'BETWEEN',
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             );
80 80
         }
81 81
 
82
-        if ($specification instanceof Filter\ValueBetween) {
82
+        if ($specification instanceof Filter\ValueBetween){
83 83
             return $source->where(
84 84
                 new Parameter($specification->getValue()),
85 85
                 'BETWEEN',
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,20 +35,25 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
37 37
     {
38
-        if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween) {
38
+        if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween)
39
+        {
39 40
             $filters = $specification->getFilters($this->asOriginal);
40
-            if (count($filters) > 1) {
41
+            if (count($filters) > 1)
42
+            {
41 43
                 return $source->where(static function () use ($compiler, $source, $filters): void {
42 44
                     $compiler->compile($source, ...$filters);
43 45
                 });
44 46
             }
45 47
         }
46 48
 
47
-        if ($specification instanceof Filter\InjectionFilter) {
49
+        if ($specification instanceof Filter\InjectionFilter)
50
+        {
48 51
             $expression = $specification->getFilter();
49
-            if ($expression instanceof Filter\Between) {
52
+            if ($expression instanceof Filter\Between)
53
+            {
50 54
                 $filters = $expression->getFilters($this->asOriginal);
51
-                if (count($filters) > 1) {
55
+                if (count($filters) > 1)
56
+                {
52 57
                     $filters = array_map(
53 58
                         static function (SpecificationInterface $filter) use ($specification): Filter\InjectionFilter {
54 59
                             return Filter\InjectionFilter::createFrom($specification, $filter);
@@ -71,7 +76,8 @@  discard block
 block discarded – undo
71 76
             }
72 77
         }
73 78
 
74
-        if ($specification instanceof Filter\Between) {
79
+        if ($specification instanceof Filter\Between)
80
+        {
75 81
             return $source->where(
76 82
                 $specification->getExpression(),
77 83
                 'BETWEEN',
@@ -79,7 +85,8 @@  discard block
 block discarded – undo
79 85
             );
80 86
         }
81 87
 
82
-        if ($specification instanceof Filter\ValueBetween) {
88
+        if ($specification instanceof Filter\ValueBetween)
89
+        {
83 90
             return $source->where(
84 91
                 new Parameter($specification->getValue()),
85 92
                 'BETWEEN',
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Response/GridResponse.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function jsonSerialize(): array
47 47
     {
48
-        if ($this->grid === null) {
48
+        if ($this->grid === null){
49 49
             return [
50 50
                 'status' => 500,
51 51
                 'error'  => 'missing-grid-source',
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
             $this->option('property', 'data') => $this->data,
58 58
         ];
59 59
 
60
-        if ($this->grid->getOption(GridInterface::PAGINATOR) !== null) {
60
+        if ($this->grid->getOption(GridInterface::PAGINATOR) !== null){
61 61
             $response['pagination'] = $this->grid->getOption(GridInterface::PAGINATOR);
62 62
         }
63 63
 
64
-        if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null) {
64
+        if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null){
65 65
             $response['pagination']['count'] = $this->grid->getOption(GridInterface::COUNT);
66 66
         }
67 67
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function jsonSerialize(): array
47 47
     {
48
-        if ($this->grid === null) {
48
+        if ($this->grid === null)
49
+        {
49 50
             return [
50 51
                 'status' => 500,
51 52
                 'error'  => 'missing-grid-source',
@@ -57,11 +58,13 @@  discard block
 block discarded – undo
57 58
             $this->option('property', 'data') => $this->data,
58 59
         ];
59 60
 
60
-        if ($this->grid->getOption(GridInterface::PAGINATOR) !== null) {
61
+        if ($this->grid->getOption(GridInterface::PAGINATOR) !== null)
62
+        {
61 63
             $response['pagination'] = $this->grid->getOption(GridInterface::PAGINATOR);
62 64
         }
63 65
 
64
-        if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null) {
66
+        if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null)
67
+        {
65 68
             $response['pagination']['count'] = $this->grid->getOption(GridInterface::COUNT);
66 69
         }
67 70
 
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Specification/Filter/InjectionFilter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     public function __construct(SpecificationInterface $expression)
27 27
     {
28
-        if (!$expression instanceof Expression && !$expression instanceof Between) {
28
+        if (!$expression instanceof Expression && !$expression instanceof Between){
29 29
             throw new LogicException('Only expression filters allowed');
30 30
         }
31 31
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
 
26 26
     public function __construct(SpecificationInterface $expression)
27 27
     {
28
-        if (!$expression instanceof Expression && !$expression instanceof Between) {
28
+        if (!$expression instanceof Expression && !$expression instanceof Between)
29
+        {
29 30
             throw new LogicException('Only expression filters allowed');
30 31
         }
31 32
 
Please login to merge, or discard this patch.
src/Bridge/DataGrid/tests/GeneratorTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 $this->db->table('users')->select('*'),
131 131
                 $schema
132 132
             )
133
-            ->withView(static function ($u) {
133
+            ->withView(static function ($u){
134 134
                 return $u['name'];
135 135
             });
136 136
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 $this->db->table('users')->select('*'),
161 161
                 $schema
162 162
             )
163
-            ->withView(static function ($u) {
163
+            ->withView(static function ($u){
164 164
                 return $u['name'];
165 165
             });
166 166
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 $this->db->table('users')->select('*'),
190 190
                 $schema
191 191
             )
192
-            ->withView(static function ($u) {
192
+            ->withView(static function ($u){
193 193
                 return $u['name'];
194 194
             });
195 195
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 $this->db->table('users')->select('*'),
219 219
                 $schema
220 220
             )
221
-            ->withView(static function ($u) {
221
+            ->withView(static function ($u){
222 222
                 return $u['name'];
223 223
             });
224 224
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -130,7 +130,8 @@  discard block
 block discarded – undo
130 130
                 $this->db->table('users')->select('*'),
131 131
                 $schema
132 132
             )
133
-            ->withView(static function ($u) {
133
+            ->withView(static function ($u)
134
+            {
134 135
                 return $u['name'];
135 136
             });
136 137
 
@@ -160,7 +161,8 @@  discard block
 block discarded – undo
160 161
                 $this->db->table('users')->select('*'),
161 162
                 $schema
162 163
             )
163
-            ->withView(static function ($u) {
164
+            ->withView(static function ($u)
165
+            {
164 166
                 return $u['name'];
165 167
             });
166 168
 
@@ -189,7 +191,8 @@  discard block
 block discarded – undo
189 191
                 $this->db->table('users')->select('*'),
190 192
                 $schema
191 193
             )
192
-            ->withView(static function ($u) {
194
+            ->withView(static function ($u)
195
+            {
193 196
                 return $u['name'];
194 197
             });
195 198
 
@@ -218,7 +221,8 @@  discard block
 block discarded – undo
218 221
                 $this->db->table('users')->select('*'),
219 222
                 $schema
220 223
             )
221
-            ->withView(static function ($u) {
224
+            ->withView(static function ($u)
225
+            {
222 226
                 return $u['name'];
223 227
             });
224 228
 
Please login to merge, or discard this patch.
src/Bridge/DataGrid/tests/QueryWriter/WriteSorterTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
             )
117 117
         );
118 118
 
119
-        if ($resultDirection === null) {
119
+        if ($resultDirection === null){
120 120
             $this->assertNull($sorter->withDirection($direction));
121
-        } else {
121
+        }else{
122 122
             $select = $this->compile(
123 123
                 $this->initQuery(),
124 124
                 $sorter->withDirection($direction)
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
     {
177 177
         $sorter = new Sorter\Sorter('balance', 'credits');
178 178
 
179
-        if ($resultDirection === null) {
179
+        if ($resultDirection === null){
180 180
             $this->assertNull($sorter->withDirection($direction));
181
-        } else {
181
+        }else{
182 182
             $select = $this->compile(
183 183
                 $this->initQuery(),
184 184
                 $sorter->withDirection($direction)
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,9 +116,12 @@  discard block
 block discarded – undo
116 116
             )
117 117
         );
118 118
 
119
-        if ($resultDirection === null) {
119
+        if ($resultDirection === null)
120
+        {
120 121
             $this->assertNull($sorter->withDirection($direction));
121
-        } else {
122
+        }
123
+        else
124
+        {
122 125
             $select = $this->compile(
123 126
                 $this->initQuery(),
124 127
                 $sorter->withDirection($direction)
@@ -176,9 +179,12 @@  discard block
 block discarded – undo
176 179
     {
177 180
         $sorter = new Sorter\Sorter('balance', 'credits');
178 181
 
179
-        if ($resultDirection === null) {
182
+        if ($resultDirection === null)
183
+        {
180 184
             $this->assertNull($sorter->withDirection($direction));
181
-        } else {
185
+        }
186
+        else
187
+        {
182 188
             $select = $this->compile(
183 189
                 $this->initQuery(),
184 190
                 $sorter->withDirection($direction)
Please login to merge, or discard this patch.