@@ -114,7 +114,7 @@ |
||
114 | 114 | foreach ($teams as $team) { |
115 | 115 | $supporters = $team->Supporters()->map()->toArray(); |
116 | 116 | // print_r(ProxyDBCounterExtension::getQueries()); |
117 | - switch($team->Title){ |
|
117 | + switch ($team->Title) { |
|
118 | 118 | case 'The Hurricanes': |
119 | 119 | $this->assertCount(3, $supporters); |
120 | 120 | $this->assertTrue(in_array('Supporter 1', $supporters)); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | return array_filter( |
67 | 67 | $this->withList, |
68 | - function ($dep) use ($list) { |
|
68 | + function($dep) use ($list) { |
|
69 | 69 | return array_key_exists($dep[0], $list); |
70 | 70 | } |
71 | 71 | ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $fields[] = "\"{$dep}ID\""; |
125 | 125 | } |
126 | 126 | $table = DataObject::getSchema()->tableName($this->dataClass); |
127 | - $data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']); |
|
127 | + $data = new SQLSelect($fields, '"'.$table.'"', ['"ID" IN ('.implode(',', $ids).')']); |
|
128 | 128 | $data = Utils::EnsureArray($data->execute(), 'ID'); |
129 | 129 | |
130 | 130 | foreach ($withHasOnes as $depSeq) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | while (count($uniqueIDs)) { |
143 | 143 | $IDsubset = array_splice($uniqueIDs, 0, self::ID_LIMIT); |
144 | 144 | $result = DataObject::get($depClass)->filter('ID', $IDsubset); |
145 | - if (count($depSeq)>1) { |
|
145 | + if (count($depSeq) > 1) { |
|
146 | 146 | $result = $result |
147 | 147 | ->with(implode('.', array_slice($depSeq, 1))); |
148 | 148 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | 'map' => [], |
180 | 180 | ]; |
181 | 181 | $result = DataObject::get($depClass)->filter($depKey, $data); |
182 | - if (count($depSeq)>1) { |
|
182 | + if (count($depSeq) > 1) { |
|
183 | 183 | $result = $result |
184 | 184 | ->with(implode('.', array_slice($depSeq, 1))); |
185 | 185 | } |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | |
221 | 221 | $table = DataObject::getSchema()->tableName($throughClass); |
222 | 222 | |
223 | - $childField = $depData['to']. 'ID'; |
|
224 | - $parentField = $depData['from']. 'ID'; |
|
223 | + $childField = $depData['to'].'ID'; |
|
224 | + $parentField = $depData['from'].'ID'; |
|
225 | 225 | } else { |
226 | 226 | $depClass = $depData; |
227 | 227 | $component = $schema->manyManyComponent($localClass, $dep); |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | |
239 | 239 | $idsQuery = SQLSelect::create( |
240 | 240 | [ |
241 | - '"' . $childField . '"', |
|
242 | - '"' . $parentField . '"', |
|
241 | + '"'.$childField.'"', |
|
242 | + '"'.$parentField.'"', |
|
243 | 243 | ], |
244 | - '"' . $table . '"', |
|
244 | + '"'.$table.'"', |
|
245 | 245 | [ |
246 | - '"' . $parentField . '" IN (' . implode(',', $data) . ')' |
|
246 | + '"'.$parentField.'" IN ('.implode(',', $data).')' |
|
247 | 247 | ] |
248 | 248 | )->execute(); |
249 | 249 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if (count($relListReverted)) { |
263 | 263 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
264 | - if (count($depSeq)>1) { |
|
264 | + if (count($depSeq) > 1) { |
|
265 | 265 | $result = $result |
266 | 266 | ->with(implode('.', array_slice($depSeq, 1))); |
267 | 267 | } |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | } |
303 | 303 | if (!method_exists($item, 'addEagerRelation')) { |
304 | 304 | throw new EagerLoadingException( |
305 | - "Model {$item->ClassName} must include " . |
|
306 | - EagerLoaderMultiAccessor::class . |
|
305 | + "Model {$item->ClassName} must include ". |
|
306 | + EagerLoaderMultiAccessor::class. |
|
307 | 307 | " trait to use eager loading for \$has_many" |
308 | 308 | ); |
309 | 309 | } |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | } |
326 | 326 | if (!method_exists($item, 'addEagerRelation')) { |
327 | 327 | throw new EagerLoadingException( |
328 | - "Model {$item->ClassName} must include " . |
|
329 | - EagerLoaderMultiAccessor::class . |
|
328 | + "Model {$item->ClassName} must include ". |
|
329 | + EagerLoaderMultiAccessor::class. |
|
330 | 330 | " trait to use eager loading for \$many_many" |
331 | 331 | ); |
332 | 332 | } |