@@ -185,7 +185,7 @@ |
||
| 185 | 185 | public function each(Closure $fn) |
| 186 | 186 | { |
| 187 | 187 | foreach ($this->elements as $key => $element) { |
| 188 | - if ( !$fn($key, $element)) { |
|
| 188 | + if (!$fn($key, $element)) { |
|
| 189 | 189 | return false; |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function testConstruct() |
| 24 | 24 | { |
| 25 | - $collection = new BaseCollection([1,2,3,4,5]); |
|
| 25 | + $collection = new BaseCollection([1, 2, 3, 4, 5]); |
|
| 26 | 26 | |
| 27 | 27 | $this->assertAttributeInternalType('array', 'elements', $collection); |
| 28 | 28 | $this->assertAttributeNotEmpty('elements', $collection); |
| 29 | 29 | $this->assertAttributeCount(5, 'elements', $collection); |
| 30 | - $this->assertAttributeEquals([1,2,3,4,5], 'elements', $collection); |
|
| 30 | + $this->assertAttributeEquals([1, 2, 3, 4, 5], 'elements', $collection); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function testTraversable() |
| 69 | 69 | { |
| 70 | - $collection = new BaseCollection([1,2,3,4,5]); |
|
| 70 | + $collection = new BaseCollection([1, 2, 3, 4, 5]); |
|
| 71 | 71 | |
| 72 | 72 | foreach ($collection as $element) { |
| 73 | 73 | $this->assertAttributeContains($element, 'elements', $collection); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function testGet() |
| 83 | 83 | { |
| 84 | - $collection = new BaseCollection([1, 2, 3,'a' => 4, 'b' => 5]); |
|
| 84 | + $collection = new BaseCollection([1, 2, 3, 'a' => 4, 'b' => 5]); |
|
| 85 | 85 | |
| 86 | 86 | $this->assertEquals(2, $collection->get(1)); |
| 87 | 87 | $this->assertEquals(4, $collection->get('a')); |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function testGetKeys() |
| 96 | 96 | { |
| 97 | - $collection = new BaseCollection([1, 2, 3,'a' => 4, 'b' => 5]); |
|
| 97 | + $collection = new BaseCollection([1, 2, 3, 'a' => 4, 'b' => 5]); |
|
| 98 | 98 | |
| 99 | - $this->assertEquals([0,1,2,'a','b'], $collection->getKeys()); |
|
| 99 | + $this->assertEquals([0, 1, 2, 'a', 'b'], $collection->getKeys()); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function testGetValues() |
| 108 | 108 | { |
| 109 | - $collection = new BaseCollection([1, 2, 3,'a' => 4, 'b' => 5]); |
|
| 109 | + $collection = new BaseCollection([1, 2, 3, 'a' => 4, 'b' => 5]); |
|
| 110 | 110 | |
| 111 | - $this->assertEquals([1,2,3,4,5], $collection->getValues()); |
|
| 111 | + $this->assertEquals([1, 2, 3, 4, 5], $collection->getValues()); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function testToArray() |
| 120 | 120 | { |
| 121 | - $collection = new BaseCollection([1, 2, 3,'a' => 4, 'b' => 5]); |
|
| 121 | + $collection = new BaseCollection([1, 2, 3, 'a' => 4, 'b' => 5]); |
|
| 122 | 122 | |
| 123 | - $this->assertEquals([1, 2, 3,'a' => 4, 'b' => 5], $collection->toArray()); |
|
| 123 | + $this->assertEquals([1, 2, 3, 'a' => 4, 'b' => 5], $collection->toArray()); |
|
| 124 | 124 | } |
| 125 | 125 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | parent::setup(); |
| 29 | 29 | |
| 30 | - $this->collection = new Collection([1,2,3]); |
|
| 30 | + $this->collection = new Collection([1, 2, 3]); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | public function testSpliceWithArrayOfReplacements() |
| 221 | 221 | { |
| 222 | - $slice = $this->collection->splice(1, 1, [7,8,9]); |
|
| 222 | + $slice = $this->collection->splice(1, 1, [7, 8, 9]); |
|
| 223 | 223 | |
| 224 | 224 | $this->assertInstanceOf(Collection::class, $slice); |
| 225 | 225 | $this->assertAttributeEquals([2], 'elements', $slice); |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | return 2 * $value; |
| 238 | 238 | }); |
| 239 | 239 | |
| 240 | - $this->assertAttributeEquals([2,4,6], 'elements', $collection); |
|
| 241 | - $this->assertAttributeEquals([1,2,3], 'elements', $this->collection); |
|
| 240 | + $this->assertAttributeEquals([2, 4, 6], 'elements', $collection); |
|
| 241 | + $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | return $a > $b ? -1 : 1; |
| 271 | 271 | }); |
| 272 | 272 | |
| 273 | - $this->assertAttributeEquals([3,2,1], 'elements', $this->collection); |
|
| 273 | + $this->assertAttributeEquals([3, 2, 1], 'elements', $this->collection); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | }); |
| 307 | 307 | |
| 308 | 308 | $this->assertTrue($success); |
| 309 | - $this->assertAttributeEquals([2,4,6], 'elements', $this->collection); |
|
| 309 | + $this->assertAttributeEquals([2, 4, 6], 'elements', $this->collection); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function testOffsetUnset() |
| 25 | 25 | { |
| 26 | - $collection = new ImmutableCollection([1,2,3]); |
|
| 26 | + $collection = new ImmutableCollection([1, 2, 3]); |
|
| 27 | 27 | |
| 28 | 28 | $collection->offsetUnset(0); |
| 29 | 29 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function testOffsetSet() |
| 38 | 38 | { |
| 39 | - $collection = new ImmutableCollection([1,2,3]); |
|
| 39 | + $collection = new ImmutableCollection([1, 2, 3]); |
|
| 40 | 40 | |
| 41 | 41 | $collection->offsetSet(0, 7); |
| 42 | 42 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @subPackage Tests |
| 15 | 15 | */ |
| 16 | 16 | call_user_func(function() { |
| 17 | - if ( ! is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) { |
|
| 17 | + if (!is_file($autoloadFile = __DIR__ . '/../vendor/autoload.php')) { |
|
| 18 | 18 | throw new \RuntimeException('Did not find vendor/autoload.php. Did you run "composer install --dev"?'); |
| 19 | 19 | } |
| 20 | 20 | |