@@ -185,7 +185,7 @@ |
||
| 185 | 185 | $expected = [ |
| 186 | 186 | 'id' => '58339e95d5200', |
| 187 | 187 | 'title' => "XML Developer's Guide", |
| 188 | - 'salePrice' => 40.46, |
|
| 188 | + 'salePrice' => 40.46, |
|
| 189 | 189 | ]; |
| 190 | 190 | |
| 191 | 191 | $this->assertSame($actual, $expected); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function setUp() |
| 27 | 27 | { |
| 28 | - $data = json_decode(file_get_contents(__DIR__ . '/books.json')); |
|
| 28 | + $data = json_decode(file_get_contents(__DIR__.'/books.json')); |
|
| 29 | 29 | $this->collection = LinqCollection::from(new ArrayIterator($data)); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function collectionCanBeCreatedFromIterator() |
| 37 | 37 | { |
| 38 | - $array = json_decode(file_get_contents(__DIR__ . '/books.json'), true); |
|
| 38 | + $array = json_decode(file_get_contents(__DIR__.'/books.json'), true); |
|
| 39 | 39 | $collection = LinqCollection::from(new ArrayIterator($array)); |
| 40 | 40 | $this->assertSame($array, iterator_to_array($collection)); |
| 41 | 41 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function collectionCanBeCreatedFromArray() |
| 48 | 48 | { |
| 49 | - $array = json_decode(file_get_contents(__DIR__ . '/books.json'), true); |
|
| 49 | + $array = json_decode(file_get_contents(__DIR__.'/books.json'), true); |
|
| 50 | 50 | $collection = LinqCollection::from($array); |
| 51 | 51 | $this->assertSame($array, iterator_to_array($collection)); |
| 52 | 52 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | public function firstReturnsDefaultIfEmpty() |
| 90 | 90 | { |
| 91 | 91 | $default = new \StdClass(); |
| 92 | - $callable = function ($element) { |
|
| 92 | + $callable = function($element) { |
|
| 93 | 93 | return false; |
| 94 | 94 | }; |
| 95 | 95 | $this->assertSame($default, $this->collection->firstOrDefault($callable, $default)); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | public function orderByOrdersSequence() |
| 112 | 112 | { |
| 113 | 113 | $collection = LinqCollection::from(['z', 'g', 'a', 'n']); |
| 114 | - $callable = function ($a, $b) { |
|
| 114 | + $callable = function($a, $b) { |
|
| 115 | 115 | return strcmp($a, $b); |
| 116 | 116 | }; |
| 117 | 117 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $this->assertEquals( |
| 134 | 134 | [ |
| 135 | - 2 => (object)[ |
|
| 135 | + 2 => (object) [ |
|
| 136 | 136 | "author" => "Corets, Eva", |
| 137 | 137 | "title" => "Maeve Ascendant", |
| 138 | 138 | "genre" => "Fantasy", |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | public function largeChain() |
| 162 | 162 | { |
| 163 | 163 | $actual = $this->collection->where( |
| 164 | - function (StdClass $book) : bool { |
|
| 164 | + function(StdClass $book) : bool { |
|
| 165 | 165 | return $book->genre === 'Computer'; |
| 166 | 166 | } |
| 167 | 167 | )->select( |
| 168 | - function (StdClass $book) : array { |
|
| 168 | + function(StdClass $book) : array { |
|
| 169 | 169 | return [ |
| 170 | 170 | 'id' => $book->id, |
| 171 | 171 | 'title' => $book->title, |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | ]; |
| 174 | 174 | } |
| 175 | 175 | )->orderBy( |
| 176 | - function (array $thisBook, array $thatBook) : int { |
|
| 176 | + function(array $thisBook, array $thatBook) : int { |
|
| 177 | 177 | if ($thisBook['salePrice'] === $thatBook['salePrice']) { |
| 178 | 178 | return 0; |
| 179 | 179 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function whereFilters() |
| 199 | 199 | { |
| 200 | - $callable = function (StdClass $book) : bool { |
|
| 200 | + $callable = function(StdClass $book) : bool { |
|
| 201 | 201 | return $book->genre === 'Romance'; |
| 202 | 202 | }; |
| 203 | 203 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $this->assertEquals( |
| 207 | 207 | [ |
| 208 | - 5 => (object)[ |
|
| 208 | + 5 => (object) [ |
|
| 209 | 209 | "author" => "Randall, Cynthia", |
| 210 | 210 | "title" => "Lover Birds", |
| 211 | 211 | "genre" => "Romance", |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | . ' ruffled.', |
| 216 | 216 | "id" => "58339e95d530e" |
| 217 | 217 | ], |
| 218 | - 6 => (object)[ |
|
| 218 | + 6 => (object) [ |
|
| 219 | 219 | "author" => "Thurman, Paula", |
| 220 | 220 | "title" => "Splish Splash", |
| 221 | 221 | "genre" => "Romance", |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function select() |
| 237 | 237 | { |
| 238 | - $callable = function (StdClass $book) : array { |
|
| 238 | + $callable = function(StdClass $book) : array { |
|
| 239 | 239 | return [ |
| 240 | 240 | 'id' => $book->id, |
| 241 | 241 | 'genre' => $book->genre, |