Passed
Push — develop ( a803f3...78e549 )
by nguereza
03:14
created
src/BaseCollection.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@  discard block
 block discarded – undo
70 70
      * Create new instance
71 71
      * @param array<mixed, mixed> $initials
72 72
      */
73
-    public function __construct(array $initials = [])
74
-    {
73
+    public function __construct(array $initials = []) {
75 74
         $this->data = new DataContainer($initials);
76 75
     }
77 76
 
@@ -108,8 +107,7 @@  discard block
 block discarded – undo
108 107
      * Return the first element of collection
109 108
      * @return mixed
110 109
      */
111
-    public function first()
112
-    {
110
+    public function first() {
113 111
         if ($this->isEmpty()) {
114 112
             throw new OutOfRangeException('The collection is empty');
115 113
         }
@@ -122,8 +120,7 @@  discard block
 block discarded – undo
122 120
      * Return the last element of collection
123 121
      * @return mixed
124 122
      */
125
-    public function last()
126
-    {
123
+    public function last() {
127 124
         if ($this->isEmpty()) {
128 125
             throw new OutOfRangeException('The collection is empty');
129 126
         }
Please login to merge, or discard this patch.
src/MergeableInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
  * @package Platine\Collection
52 52
  * @template T
53 53
  */
54
-interface MergeableInterface
55
-{
54
+interface MergeableInterface {
56 55
 
57 56
     /**
58 57
      * Merge with the given collection
Please login to merge, or discard this patch.
src/IterableInterface.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,5 +58,5 @@
 block discarded – undo
58 58
      * @param callable $callback
59 59
      * @return void
60 60
      */
61
-    public function forEach(callable $callback): void;
61
+    public function forEach (callable $callback): void;
62 62
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
  * Class IterableInterface
51 51
  * @package Platine\Collection
52 52
  */
53
-interface IterableInterface
54
-{
53
+interface IterableInterface {
55 54
 
56 55
     /**
57 56
      * Loop on each collection element with the given callback
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,5 +58,5 @@
 block discarded – undo
58 58
      * @param callable $callback
59 59
      * @return void
60 60
      */
61
-    public function forEach(callable $callback): void;
61
+    public function foreach(callable $callback): void;
62 62
 }
Please login to merge, or discard this patch.
src/Generic/ArrayList.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $diffValues = array_udiff(
107 107
             $this->all(),
108 108
             $collection->all(),
109
-            function ($a, $b) {
109
+            function($a, $b) {
110 110
                 if (gettype($a) !== gettype($b)) {
111 111
                     return -1;
112 112
                 }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     /**
157 157
      * {@inheritedoc}
158 158
      */
159
-    public function forEach(callable $callback): void
159
+    public function forEach (callable $callback): void
160 160
     {
161 161
         $data = $this->all();
162 162
         array_walk($data, $callback);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -167,8 +167,7 @@  discard block
 block discarded – undo
167 167
     /**
168 168
      * {@inheritedoc}
169 169
      */
170
-    public function get(int $offset)
171
-    {
170
+    public function get(int $offset) {
172 171
         return $this->data->offsetGet($offset);
173 172
     }
174 173
 
@@ -198,8 +197,7 @@  discard block
 block discarded – undo
198 197
      * Return a random element of the collection
199 198
      * @return mixed
200 199
      */
201
-    public function rand()
202
-    {
200
+    public function rand() {
203 201
         if ($this->isEmpty()) {
204 202
             throw new InvalidOperationException('The collection is empty');
205 203
         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
     /**
157 157
      * {@inheritedoc}
158 158
      */
159
-    public function forEach(callable $callback): void
159
+    public function foreach(callable $callback): void
160 160
     {
161 161
         $data = $this->all();
162 162
         array_walk($data, $callback);
Please login to merge, or discard this patch.
src/SortableInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
  * @package Platine\Collection
52 52
  * @template T
53 53
  */
54
-interface SortableInterface
55
-{
54
+interface SortableInterface {
56 55
 
57 56
     /**
58 57
      * Sort the collection
Please login to merge, or discard this patch.
src/TypedCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,16 +55,14 @@
 block discarded – undo
55 55
  * @template T
56 56
  * @extends Collection<T>
57 57
  */
58
-class TypedCollection extends Collection
59
-{
58
+class TypedCollection extends Collection {
60 59
 
61 60
     /**
62 61
      * Create new instance
63 62
      * @param string $type
64 63
      * @param mixed ...$data
65 64
      */
66
-    public function __construct(string $type, ...$data)
67
-    {
65
+    public function __construct(string $type, ...$data) {
68 66
         $this->type = $type;
69 67
         parent::__construct(...$data);
70 68
     }
Please login to merge, or discard this patch.
src/DataContainer.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@  discard block
 block discarded – undo
70 70
      * Create new instance
71 71
      * @param array<mixed, mixed> $data
72 72
      */
73
-    public function __construct(array $data = [])
74
-    {
73
+    public function __construct(array $data = []) {
75 74
         $this->data = $data;
76 75
     }
77 76
 
@@ -121,8 +120,7 @@  discard block
 block discarded – undo
121 120
      * @param mixed $offset
122 121
      * @return mixed
123 122
      */
124
-    public function offsetGet($offset)
125
-    {
123
+    public function offsetGet($offset) {
126 124
         return isset($this->data[$offset])
127 125
                 ? $this->data[$offset]
128 126
                 : null;
Please login to merge, or discard this patch.
src/ObjectCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,15 +52,13 @@
 block discarded – undo
52 52
  * @template Object
53 53
  * @extends TypedCollection<Object>
54 54
  */
55
-class ObjectCollection extends TypedCollection
56
-{
55
+class ObjectCollection extends TypedCollection {
57 56
 
58 57
     /**
59 58
      * Create new instance
60 59
      * @param mixed ...$data
61 60
      */
62
-    public function __construct(...$data)
63
-    {
61
+    public function __construct(...$data) {
64 62
         parent::__construct('object', ...$data);
65 63
     }
66 64
 }
Please login to merge, or discard this patch.
src/CollectionInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
  * Class CollectionInterface
51 51
  * @package Platine\Collection
52 52
  */
53
-interface CollectionInterface
54
-{
53
+interface CollectionInterface {
55 54
 
56 55
     /**
57 56
      * Add element to the collection
Please login to merge, or discard this patch.