@@ -45,7 +45,7 @@ |
||
45 | 45 | * @param bool|null $save_indexes Ignored parameter. |
46 | 46 | * @return self|static |
47 | 47 | */ |
48 | - final public static function fromArray($array, $save_indexes = null): self |
|
48 | + final public static function fromArray($array, $save_indexes=null): self |
|
49 | 49 | { |
50 | 50 | return new static(...$array); |
51 | 51 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | return $this->newCopy(array_filter( |
31 | 31 | $this->items(), |
32 | - function ($item) use ($others) : bool { |
|
32 | + function($item) use ($others) : bool { |
|
33 | 33 | foreach ($others as $otherCollection) { |
34 | 34 | if (in_array($item, $otherCollection->items(), false)) { |
35 | 35 | return false; |
@@ -26,8 +26,8 @@ |
||
26 | 26 | */ |
27 | 27 | public function change(int $index, $newItem): Alterable |
28 | 28 | { |
29 | - $items = $this->items(); |
|
30 | - $items[$index] = $newItem; |
|
29 | + $items=$this->items(); |
|
30 | + $items[$index]=$newItem; |
|
31 | 31 | return $this->newCopy($items); |
32 | 32 | } |
33 | 33 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function find($item): int |
52 | 52 | { |
53 | - $position = $this->positionOf($item); |
|
53 | + $position=$this->positionOf($item); |
|
54 | 54 | $this->mustBeValid($position, $item); |
55 | 55 | return $position; |
56 | 56 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function findThe($object): int |
65 | 65 | { |
66 | - $position = array_search($object, $this->items(), true); |
|
66 | + $position=array_search($object, $this->items(), true); |
|
67 | 67 | $this->mustBeValid($position, $object); |
68 | 68 | return $position; |
69 | 69 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function delete(int $index): Purgeable |
27 | 27 | { |
28 | - $items = $this->items(); |
|
28 | + $items=$this->items(); |
|
29 | 29 | unset($items[$index]); |
30 | 30 | return $this->newCopy($items); |
31 | 31 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | return $this->newCopy(array_filter( |
41 | 41 | $this->items(), |
42 | - function ($item) use ($itemsToRemove) { |
|
42 | + function($item) use ($itemsToRemove) { |
|
43 | 43 | return !in_array($item, $itemsToRemove, true); |
44 | 44 | } |
45 | 45 | )); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public static function byOverWriting(Collection $collection, int $index): NotAllowed |
58 | 58 | { |
59 | 59 | return new static(sprintf( |
60 | - 'Cannot write to the immutable collection `%s`. ' . |
|
60 | + 'Cannot write to the immutable collection `%s`. '. |
|
61 | 61 | '(Tried writing to position %d).', |
62 | 62 | get_class($collection), |
63 | 63 | $index |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public static function byRemoving(Collection $collection, int $index): NotAllowed |
75 | 75 | { |
76 | 76 | return new static(sprintf( |
77 | - 'Cannot alter the immutable collection `%s`. ' . |
|
77 | + 'Cannot alter the immutable collection `%s`. '. |
|
78 | 78 | '(Tried to unset position %d).', |
79 | 79 | get_class($collection), |
80 | 80 | $index |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public static function byResizingTo(Collection $collection, int $size): NotAllowed |
92 | 92 | { |
93 | 93 | return new static(sprintf( |
94 | - 'Cannot directly resize the immutable collection `%s`. ' . |
|
94 | + 'Cannot directly resize the immutable collection `%s`. '. |
|
95 | 95 | '(Tried to resize from %d to %d).', |
96 | 96 | get_class($collection), |
97 | 97 | count($collection), |