Completed
Push — master ( 837794...775998 )
by
unknown
05:11
created
src/Domain/Model/Repository/Filter.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     }
51 51
 
52 52
     /**
53
-     * @param $name
53
+     * @param integer $name
54 54
      *
55 55
      * @return BaseFilterInterface
56 56
      */
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     }
93 93
 
94 94
     /**
95
-     * @param $name
95
+     * @param integer $name
96 96
      */
97 97
     protected function clearCollection($name)
98 98
     {
Please login to merge, or discard this patch.
src/Domain/Model/Repository/Pageable.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
     /**
43 43
      * Pageable constructor.
44 44
      *
45
-     * @param                      $pageNumber
46
-     * @param                      $pageSize
45
+     * @param                      integer $pageNumber
46
+     * @param                      integer $pageSize
47 47
      * @param SortInterface|null   $sort
48 48
      * @param FilterInterface|null $filter
49 49
      * @param FieldsInterface|null $fields
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
         FilterInterface $filter = null,
56 56
         FieldsInterface $fields = null
57 57
     ) {
58
-        $this->pageNumber = (int)$pageNumber;
59
-        $this->pageSize   = (int)$pageSize;
58
+        $this->pageNumber = (int) $pageNumber;
59
+        $this->pageSize   = (int) $pageSize;
60 60
         $this->sort       = $sort;
61 61
         $this->filter     = $filter;
62 62
         $this->fields     = $fields;
Please login to merge, or discard this patch.
src/Infrastructure/Model/Repository/InMemory/InMemoryFilter.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
 
27 27
     /**
28
-     * @param array  $results
28
+     * @param \NilPortugues\Foundation\Domain\Model\Repository\Contracts\Identity[]  $results
29 29
      * @param Filter $filter
30 30
      * @return array
31 31
      */
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     private static function notEquals($property, $value)
193 193
     {
194
-        return function ($v, $k) use ($property, $value) {
194
+        return function($v, $k) use ($property, $value) {
195 195
             return InMemoryValue::get($v, $property) != $value;
196 196
         };
197 197
     }
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     private static function equals($property, $value)
206 206
     {
207
-        return function ($v, $k) use ($property, $value) {
207
+        return function($v, $k) use ($property, $value) {
208 208
             return InMemoryValue::get($v, $property) == $value;
209 209
         };
210 210
     }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     private static function greaterThanOrEqual($property, $value)
219 219
     {
220
-        return function ($v, $k) use ($property, $value) {
220
+        return function($v, $k) use ($property, $value) {
221 221
             return InMemoryValue::get($v, $property) >= $value;
222 222
         };
223 223
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     private static function endsWith($property, $value)
232 232
     {
233
-        return function ($v, $k) use ($property, $value) {
233
+        return function($v, $k) use ($property, $value) {
234 234
             $v = InMemoryValue::get($v, $property);
235 235
 
236 236
             if (false === is_scalar($v)) {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     private static function startsWith($property, $value)
255 255
     {
256
-        return function ($v, $k) use ($property, $value) {
256
+        return function($v, $k) use ($property, $value) {
257 257
             $v = InMemoryValue::get($v, $property);
258 258
 
259 259
             if (false === is_scalar($v)) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      */
277 277
     private static function notContains($property, $value)
278 278
     {
279
-        return function ($v, $k) use ($property, $value) {
279
+        return function($v, $k) use ($property, $value) {
280 280
             $v = InMemoryValue::get($v, $property);
281 281
 
282 282
             if (is_scalar($v)) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      */
308 308
     private static function contains($property, $value)
309 309
     {
310
-        return function ($v, $k) use ($property, $value) {
310
+        return function($v, $k) use ($property, $value) {
311 311
             $v = InMemoryValue::get($v, $property);
312 312
 
313 313
             if (is_scalar($v)) {
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     private static function lessThan($property, $value)
339 339
     {
340
-        return function ($v, $k) use ($property, $value) {
340
+        return function($v, $k) use ($property, $value) {
341 341
             return InMemoryValue::get($v, $property) < $value;
342 342
         };
343 343
     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      */
351 351
     private static function lessThanOrEqual($property, $value)
352 352
     {
353
-        return function ($v, $k) use ($property, $value) {
353
+        return function($v, $k) use ($property, $value) {
354 354
             return InMemoryValue::get($v, $property) <= $value;
355 355
         };
356 356
     }
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
      */
364 364
     private static function greaterThan($property, $value)
365 365
     {
366
-        return function ($v, $k) use ($property, $value) {
366
+        return function($v, $k) use ($property, $value) {
367 367
             return InMemoryValue::get($v, $property) > $value;
368 368
         };
369 369
     }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      */
377 377
     private static function in($property, array $value)
378 378
     {
379
-        return function ($v, $k) use ($property, $value) {
379
+        return function($v, $k) use ($property, $value) {
380 380
             $hasGroup = true;
381 381
             $v        = InMemoryValue::get($v, $property);
382 382
 
@@ -401,13 +401,13 @@  discard block
 block discarded – undo
401 401
      */
402 402
     private static function notIn($property, array $value)
403 403
     {
404
-        return function ($v, $k) use ($property, $value) {
404
+        return function($v, $k) use ($property, $value) {
405 405
             $hasGroup = true;
406 406
             $v        = InMemoryValue::get($v, $property);
407 407
 
408 408
             foreach ($value as $groupItem) {
409 409
                 if (is_scalar($v)) {
410
-                    $hasGroup = $hasGroup  && 1 == preg_match(sprintf('/%s/i', $groupItem), $v);
410
+                    $hasGroup = $hasGroup && 1 == preg_match(sprintf('/%s/i', $groupItem), $v);
411 411
                 }
412 412
 
413 413
                 if (is_array($v)) {
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     private static function notRanges($property, $value1, $value2)
429 429
     {
430
-        return function ($v, $k) use ($property, $value1, $value2) {
430
+        return function($v, $k) use ($property, $value1, $value2) {
431 431
             $v = InMemoryValue::get($v, $property);
432 432
 
433 433
             //@todo check if $v is of "type" and $value1 or $value2 are of the same "type" to... (is_object, is_scalar)
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
      */
446 446
     private static function ranges($property, $value1, $value2)
447 447
     {
448
-        return function ($v, $k) use ($property, $value1, $value2) {
448
+        return function($v, $k) use ($property, $value1, $value2) {
449 449
             $v = InMemoryValue::get($v, $property);
450 450
 
451 451
             //@todo check if $v is of "type" and $value1 or $value2 are of the same "type" to... (is_object, is_scalar)
Please login to merge, or discard this patch.
src/Domain/Model/Repository/Page.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
      * Page constructor.
54 54
      *
55 55
      * @param array           $elements
56
-     * @param                 $totalElements
57
-     * @param                 $pageNumber
56
+     * @param                 integer $totalElements
57
+     * @param                 integer $pageNumber
58 58
      * @param                 $totalPages
59 59
      * @param SortInterface   $sort
60 60
      * @param FilterInterface $filter
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     }
194 194
 
195 195
     /**
196
-     * @return FieldsInterface
196
+     * @return null|FieldsInterface
197 197
      */
198 198
     public function getFields()
199 199
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@
 block discarded – undo
70 70
         FieldsInterface $fields = null
71 71
     ) {
72 72
         $this->elements      = ImmutableTypedCollection::fromArray($elements);
73
-        $this->totalElements = (int)$totalElements;
74
-        $this->pageNumber    = (int)$pageNumber;
75
-        $this->totalPages    = (int)$totalPages;
73
+        $this->totalElements = (int) $totalElements;
74
+        $this->pageNumber    = (int) $pageNumber;
75
+        $this->totalPages    = (int) $totalPages;
76 76
         $this->sort          = ($sort) ? $sort : new Sort();
77 77
         $this->filter        = ($filter) ? $filter : new Filter();
78 78
         $this->fields        = ($fields) ? $fields : new Fields();
Please login to merge, or discard this patch.
example/ColorRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             throw new ColorNotFoundException($id);
46 46
         }
47 47
 
48
-        $id = (string)$id;
48
+        $id = (string) $id;
49 49
 
50 50
         return clone $this->data[$id];
51 51
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function persist($value)
87 87
     {
88
-        $id = (string)$value->id();
88
+        $id = (string) $value->id();
89 89
 
90 90
         $this->data[$id] = clone $value;
91 91
     }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function exists(Identity $id)
156 156
     {
157
-        $id = (string)$id;
157
+        $id = (string) $id;
158 158
 
159 159
         return array_key_exists($id, $this->data);
160 160
     }
Please login to merge, or discard this patch.
example/example.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
2 2
 
3
-include __DIR__ . '/../vendor/autoload.php';
3
+include __DIR__.'/../vendor/autoload.php';
4 4
 
5 5
 use NilPortugues\Example\Repository\Color;
6 6
 use NilPortugues\Example\Repository\ColorRepository;
Please login to merge, or discard this patch.
example/Color.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,6 +60,6 @@
 block discarded – undo
60 60
      */
61 61
     public function __toString()
62 62
     {
63
-        return (string)$this->getHexCode();
63
+        return (string) $this->getHexCode();
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
src/Infrastructure/Model/Repository/InMemory/InMemorySorter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
         /** @var Order $sortDirection */
34 34
         foreach ($sortOrder as $propertyName => $sortDirection) {
35 35
             if ($sortDirection->isAscending()) {
36
-                self::stableUasort($results, function ($a, $b) use ($propertyName) {
37
-                    $value1 = (string)InMemoryValue::get($a, $propertyName);
38
-                    $value2 = (string)InMemoryValue::get($b, $propertyName);
36
+                self::stableUasort($results, function($a, $b) use ($propertyName) {
37
+                    $value1 = (string) InMemoryValue::get($a, $propertyName);
38
+                    $value2 = (string) InMemoryValue::get($b, $propertyName);
39 39
 
40
-                    return ((int)(strcmp($value1, $value2) >= 0));
40
+                    return ((int) (strcmp($value1, $value2) >= 0));
41 41
                 });
42 42
             } else {
43
-                self::stableUasort($results, function ($a, $b) use ($propertyName) {
44
-                    $value1 = (string)InMemoryValue::get($a, $propertyName);
45
-                    $value2 = (string)InMemoryValue::get($b, $propertyName);
43
+                self::stableUasort($results, function($a, $b) use ($propertyName) {
44
+                    $value1 = (string) InMemoryValue::get($a, $propertyName);
45
+                    $value2 = (string) InMemoryValue::get($b, $propertyName);
46 46
 
47
-                    return ((int)(strcmp($value1, $value2) < 0));
47
+                    return ((int) (strcmp($value1, $value2) < 0));
48 48
                 });
49 49
             }
50 50
         }
Please login to merge, or discard this patch.
src/Infrastructure/Model/Repository/InMemory/InMemoryValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
             return $object->{$property}();
23 23
         }
24 24
 
25
-        if (method_exists(get_class($object), 'get' . $property)) {
26
-            $property = 'get' . $property;
25
+        if (method_exists(get_class($object), 'get'.$property)) {
26
+            $property = 'get'.$property;
27 27
 
28 28
             return $object->{$property}();
29 29
         }
Please login to merge, or discard this patch.