Completed
Branch master (f41212)
by Rudi
01:59
created
src/Ds/Sequence.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param array|\Traversable $values
16 16
      */
17
-    function __construct($values = null);
17
+    function __construct($values = NULL);
18 18
 
19 19
     /**
20 20
      * Ensures that enough memory is allocated for a specified capacity. This
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @return Sequence
55 55
      */
56
-    function filter(callable $callback = null): Sequence;
56
+    function filter(callable $callback = NULL): Sequence;
57 57
 
58 58
     /**
59 59
      * Returns the index of a given value, or false if it could not be found.
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @return string
107 107
      */
108
-    function join(string $glue = null): string;
108
+    function join(string $glue = NULL): string;
109 109
 
110 110
     /**
111 111
      * Returns the last value in the sequence.
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @return mixed The carry value of the final iteration, or the initial
170 170
      *               value if the sequence was empty.
171 171
      */
172
-    function reduce(callable $callback, $initial = null);
172
+    function reduce(callable $callback, $initial = NULL);
173 173
 
174 174
     /**
175 175
      * Removes and returns the value at a given index in the sequence.
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      *
239 239
      * @return Sequence
240 240
      */
241
-    function slice(int $offset, int $length = null): Sequence;
241
+    function slice(int $offset, int $length = NULL): Sequence;
242 242
 
243 243
     /**
244 244
      * Returns a sorted copy of the sequence, based on an optional callable
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      *
250 250
      * @return Sequence
251 251
      */
252
-    function sort(callable $comparator = null): Sequence;
252
+    function sort(callable $comparator = NULL): Sequence;
253 253
 
254 254
     /**
255 255
      * Adds zero or more values to the front of the sequence.
Please login to merge, or discard this patch.
src/Ds/Traits/Sequence.php 1 patch
Upper-Lower-Casing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @inheritDoc
23 23
      */
24
-    public function __construct($values = null)
24
+    public function __construct($values = NULL)
25 25
     {
26 26
         if ($values) {
27 27
             if (is_integer($values)) {
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
     public function contains(...$values): bool
66 66
     {
67 67
         if ( ! $values) {
68
-            return false;
68
+            return FALSE;
69 69
         }
70 70
 
71 71
         foreach ($values as $value) {
72
-            if ($this->find($value) === false) {
73
-                return false;
72
+            if ($this->find($value) === FALSE) {
73
+                return FALSE;
74 74
             }
75 75
         }
76 76
 
77
-        return true;
77
+        return TRUE;
78 78
     }
79 79
 
80 80
     /**
81 81
      * @inheritDoc
82 82
      */
83
-    public function filter(callable $callback = null): \Ds\Sequence
83
+    public function filter(callable $callback = NULL): \Ds\Sequence
84 84
     {
85 85
         if ($callback) {
86 86
             return new self(array_filter($this->internal, $callback));
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function find($value)
96 96
     {
97
-        return array_search($value, $this->internal, true);
97
+        return array_search($value, $this->internal, TRUE);
98 98
     }
99 99
 
100 100
     /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     /**
135 135
      * @inheritDoc
136 136
      */
137
-    public function join(string $glue = null): string
137
+    public function join(string $glue = NULL): string
138 138
     {
139 139
         return implode($glue, $this->internal);
140 140
     }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     /**
201 201
      * @inheritDoc
202 202
      */
203
-    public function reduce(callable $callback, $initial = null)
203
+    public function reduce(callable $callback, $initial = NULL)
204 204
     {
205 205
         return array_reduce($this->internal, $callback, $initial);
206 206
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     {
213 213
         $this->checkRange($index);
214 214
 
215
-        $value = array_splice($this->internal, $index, 1, null)[0];
215
+        $value = array_splice($this->internal, $index, 1, NULL)[0];
216 216
         $this->adjustCapacity();
217 217
 
218 218
         return $value;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     /**
294 294
      * @inheritDoc
295 295
      */
296
-    public function slice(int $offset, int $length = null): \Ds\Sequence
296
+    public function slice(int $offset, int $length = NULL): \Ds\Sequence
297 297
     {
298 298
         if (func_num_args() === 1) {
299 299
             return new self(array_slice($this->internal, $offset));
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     /**
306 306
      * @inheritDoc
307 307
      */
308
-    public function sort(callable $comparator = null): \Ds\Sequence
308
+    public function sort(callable $comparator = NULL): \Ds\Sequence
309 309
     {
310 310
         $internal = $this->internal;
311 311
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function offsetSet($offset, $value)
367 367
     {
368
-        if ($offset === null) {
368
+        if ($offset === NULL) {
369 369
             $this->push($value);
370 370
         } else {
371 371
             $this->set($offset, $value);
@@ -398,9 +398,9 @@  discard block
 block discarded – undo
398 398
     public function offsetExists($offset)
399 399
     {
400 400
         if ($offset < 0 || $offset >= count($this)) {
401
-            return false;
401
+            return FALSE;
402 402
         }
403 403
 
404
-        return $this->get($offset) !== null;
404
+        return $this->get($offset) !== NULL;
405 405
     }
406 406
 }
Please login to merge, or discard this patch.
src/Ds/Queue.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @param array|\Traversable $values
23 23
      */
24
-    public function __construct($values = null)
24
+    public function __construct($values = NULL)
25 25
     {
26 26
         $this->internal = new Deque($values);
27 27
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function offsetSet($offset, $value)
143 143
     {
144
-        if ($offset === null) {
144
+        if ($offset === NULL) {
145 145
             $this->push($value);
146 146
         } else {
147 147
             throw new Error();
Please login to merge, or discard this patch.
src/Ds/Map.php 1 patch
Upper-Lower-Casing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @param array|\Traversable $values
29 29
      */
30
-    public function __construct($values = null)
30
+    public function __construct($values = NULL)
31 31
     {
32 32
         if ($values) {
33 33
             if (is_integer($values)) {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             }
232 232
         }
233 233
 
234
-        $pair = null;
234
+        $pair = NULL;
235 235
 
236 236
         return $pair;
237 237
     }
@@ -247,16 +247,16 @@  discard block
 block discarded – undo
247 247
     public function containsKey(...$keys): bool
248 248
     {
249 249
         if ( ! $keys) {
250
-            return false;
250
+            return FALSE;
251 251
         }
252 252
 
253 253
         foreach ($keys as $key) {
254 254
             if ( ! $this->lookup($key)) {
255
-                return false;
255
+                return FALSE;
256 256
             }
257 257
         }
258 258
 
259
-        return true;
259
+        return TRUE;
260 260
     }
261 261
 
262 262
     /**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     public function containsValue(...$values): bool
271 271
     {
272 272
         if ( ! $values) {
273
-            return false;
273
+            return FALSE;
274 274
         }
275 275
 
276 276
         foreach ($values as $value) {
@@ -280,10 +280,10 @@  discard block
 block discarded – undo
280 280
                 }
281 281
             }
282 282
 
283
-            return false;
283
+            return FALSE;
284 284
         }
285 285
 
286
-        return true;
286
+        return TRUE;
287 287
     }
288 288
 
289 289
     /**
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      *
313 313
      * @return Map
314 314
      */
315
-    public function filter(callable $callback = null): Map
315
+    public function filter(callable $callback = NULL): Map
316 316
     {
317 317
         $filtered = new self();
318 318
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      * @throws OutOfBoundsException if no default was provided and the key is
341 341
      *                               not associated with a value.
342 342
      */
343
-    public function get($key, $default = null)
343
+    public function get($key, $default = NULL)
344 344
     {
345 345
         if (($pair = $this->lookup($key))) {
346 346
             return $pair->value;
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
      * @return mixed The carry value of the final iteration, or the initial
450 450
      *               value if the map was empty.
451 451
      */
452
-    public function reduce(callable $callback, $initial = null)
452
+    public function reduce(callable $callback, $initial = NULL)
453 453
     {
454 454
         $carry = $initial;
455 455
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      * @throws \OutOfBoundsException if no default was provided and the key is
473 473
      *                               not associated with a value.
474 474
      */
475
-    public function remove($key, $default = null)
475
+    public function remove($key, $default = NULL)
476 476
     {
477 477
         foreach ($this->pairs as $position => $pair) {
478 478
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
                 // Delete pair, return its value
483 483
                 $value = $pair->value;
484 484
 
485
-                array_splice($this->pairs, $position, 1, null);
485
+                array_splice($this->pairs, $position, 1, NULL);
486 486
                 $this->adjustCapacity();
487 487
 
488 488
                 return $value;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
      *
533 533
      * @return Map
534 534
      */
535
-    public function slice(int $offset, int $length = null): Map
535
+    public function slice(int $offset, int $length = NULL): Map
536 536
     {
537 537
         $map = new Map();
538 538
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
      *
559 559
      * @return Map
560 560
      */
561
-    public function sort(callable $comparator = null): Map
561
+    public function sort(callable $comparator = NULL): Map
562 562
     {
563 563
         $copy = $this->copy();
564 564
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
      */
657 657
     public function offsetUnset($offset)
658 658
     {
659
-        $this->remove($offset, null);
659
+        $this->remove($offset, NULL);
660 660
     }
661 661
 
662 662
     /**
@@ -664,6 +664,6 @@  discard block
 block discarded – undo
664 664
      */
665 665
     public function offsetExists($offset)
666 666
     {
667
-        return $this->get($offset, null) !== null;
667
+        return $this->get($offset, NULL) !== NULL;
668 668
     }
669 669
 }
Please login to merge, or discard this patch.
src/Ds/Stack.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @param array|\Traversable $values
25 25
      */
26
-    public function __construct($values = null)
26
+    public function __construct($values = NULL)
27 27
     {
28 28
         $this->internal = new Vector($values);
29 29
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function getIterator()
138 138
     {
139
-        while ($this->isEmpty() === false) {
139
+        while ($this->isEmpty() === FALSE) {
140 140
             yield $this->pop();
141 141
         }
142 142
     }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function offsetSet($offset, $value)
150 150
     {
151
-        if ($offset === null) {
151
+        if ($offset === NULL) {
152 152
             $this->push($value);
153 153
         } else {
154 154
             throw new Error();
Please login to merge, or discard this patch.
src/Ds/Set.php 1 patch
Upper-Lower-Casing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @param array|\Traversable $values
29 29
      */
30
-    public function __construct($values = null)
30
+    public function __construct($values = NULL)
31 31
     {
32 32
         $this->internal = new Map();
33 33
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function add(...$values)
49 49
     {
50 50
         foreach ($values as $value) {
51
-            $this->internal[$value] = null;
51
+            $this->internal[$value] = NULL;
52 52
         }
53 53
     }
54 54
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         if ($values) {
63 63
             foreach ($values as $value) {
64
-                $this->internal[$value] = null;
64
+                $this->internal[$value] = NULL;
65 65
             }
66 66
         }
67 67
     }
@@ -108,16 +108,16 @@  discard block
 block discarded – undo
108 108
     public function contains(...$values): bool
109 109
     {
110 110
         if ( ! $values) {
111
-            return false;
111
+            return FALSE;
112 112
         }
113 113
 
114 114
         foreach ($values as $value) {
115 115
             if ( ! $this->internal->containsKey($value)) {
116
-                return false;
116
+                return FALSE;
117 117
             }
118 118
         }
119 119
 
120
-        return true;
120
+        return TRUE;
121 121
     }
122 122
 
123 123
     /**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      *
202 202
      * @return Set
203 203
      */
204
-    public function filter(callable $callback = null): Set
204
+    public function filter(callable $callback = NULL): Set
205 205
     {
206 206
         $filtered = new Set();
207 207
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      *
291 291
      * @return string
292 292
      */
293
-    public function join(string $glue = null): string
293
+    public function join(string $glue = NULL): string
294 294
     {
295 295
         return implode($glue, $this->toArray());
296 296
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      * @return mixed The carry value of the final iteration, or the initial
317 317
      *               value if the set was empty.
318 318
      */
319
-    public function reduce(callable $callback, $initial = null)
319
+    public function reduce(callable $callback, $initial = NULL)
320 320
     {
321 321
         $carry = $initial;
322 322
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     public function remove(...$values)
336 336
     {
337 337
         foreach ($values as $value) {
338
-            $this->internal->remove($value, null);
338
+            $this->internal->remove($value, NULL);
339 339
         }
340 340
     }
341 341
 
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      *
374 374
      * @return Set
375 375
      */
376
-    public function slice(int $offset, int $length = null): Set
376
+    public function slice(int $offset, int $length = NULL): Set
377 377
     {
378 378
         $sliced = new Set();
379 379
         $sliced->internal = $this->internal->slice($offset, $length);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
      *
391 391
      * @return Set
392 392
      */
393
-    public function sort(callable $comparator = null): Set
393
+    public function sort(callable $comparator = NULL): Set
394 394
     {
395 395
         $set = new Set();
396 396
         $set->internal = $this->internal->sort($comparator);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
      */
449 449
     public function offsetSet($offset, $value)
450 450
     {
451
-        if ($offset === null) {
451
+        if ($offset === NULL) {
452 452
             $this->add($value);
453 453
             return;
454 454
         }
Please login to merge, or discard this patch.
src/Ds/Pair.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      * @param mixed $key
25 25
      * @param mixed $value
26 26
      */
27
-    public function __construct($key = null, $value = null)
27
+    public function __construct($key = NULL, $value = NULL)
28 28
     {
29 29
         $this->key = $key;
30 30
         $this->value = $value;
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     public function __get($name)
41 41
     {
42 42
         if ($name === 'key') {
43
-            $this->key = null;
43
+            $this->key = NULL;
44 44
             return $this->key;
45 45
         }
46 46
 
47 47
         if ($name === 'value') {
48
-            $this->value = null;
48
+            $this->value = NULL;
49 49
             return $this->value;
50 50
         }
51 51
     }
Please login to merge, or discard this patch.
src/ds.php 1 patch
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
      *
11 11
      * @return Ds\Vector
12 12
      */
13
-    public static function vector($values = null): Ds\Vector
13
+    public static function vector($values = NULL): Ds\Vector
14 14
     {
15 15
         return new Ds\Vector($values);
16 16
     }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      *
21 21
      * @return Ds\Deque
22 22
      */
23
-    public static function deque($values = null): Ds\Deque
23
+    public static function deque($values = NULL): Ds\Deque
24 24
     {
25 25
         return new Ds\Deque($values);
26 26
     }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return Ds\Set
32 32
      */
33
-    public static function set($values = null): Ds\Set
33
+    public static function set($values = NULL): Ds\Set
34 34
     {
35 35
         return new Ds\Set($values);
36 36
     }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return Ds\Map
42 42
      */
43
-    public static function map($values = null): Ds\Map
43
+    public static function map($values = NULL): Ds\Map
44 44
     {
45 45
         return new Ds\Map($values);
46 46
     }
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      *
51 51
      * @return Ds\Stack
52 52
      */
53
-    public static function stack($values = null): Ds\Stack
53
+    public static function stack($values = NULL): Ds\Stack
54 54
     {
55 55
         return new Ds\Stack($values);
56 56
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return Ds\Queue
62 62
      */
63
-    public static function queue($values = null): Ds\Queue
63
+    public static function queue($values = NULL): Ds\Queue
64 64
     {
65 65
         return new Ds\Queue($values);
66 66
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      *
80 80
      * @return Ds\Pair
81 81
      */
82
-    public static function pair($key = null, $value = null): Ds\Pair
82
+    public static function pair($key = NULL, $value = NULL): Ds\Pair
83 83
     {
84 84
         return new Ds\Pair($key, $value);
85 85
     }
Please login to merge, or discard this patch.