@@ -27,7 +27,7 @@ |
||
27 | 27 | } |
28 | 28 | $this->owner->withListOriginal = $list; |
29 | 29 | $list = array_map( |
30 | - function ($e) { |
|
30 | + function($e) { |
|
31 | 31 | return explode('.', $e); |
32 | 32 | }, |
33 | 33 | $list |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | return array_filter( |
65 | 65 | $this->withList, |
66 | - function ($dep) use ($list) { |
|
66 | + function($dep) use ($list) { |
|
67 | 67 | return array_key_exists($dep[0], $list); |
68 | 68 | } |
69 | 69 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | if (!count($withHasOnes) && !count($withHasManys) && !count($withManyManys) && !count($withBelongsManyManys)) { |
92 | 92 | throw new EagerLoadingException( |
93 | - "Invalid names supplied for ->with(" . implode(', ', $this->withListOriginal) . ")" |
|
93 | + "Invalid names supplied for ->with(".implode(', ', $this->withListOriginal).")" |
|
94 | 94 | ); |
95 | 95 | } |
96 | 96 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $fields[] = "{$dep}ID"; |
125 | 125 | } |
126 | 126 | $table = Config::forClass($this->dataClass)->get('table_name'); |
127 | - $data = new SQLSelect(implode(',', $fields), [$table], ["ID IN (" . implode(',', $ids) . ")"]); |
|
127 | + $data = new SQLSelect(implode(',', $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 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | 'map' => [], |
174 | 174 | ]; |
175 | 175 | $result = DataObject::get($depClass)->filter($depKey, $data); |
176 | - if (count($depSeq)>1) { |
|
176 | + if (count($depSeq) > 1) { |
|
177 | 177 | $result = $result |
178 | 178 | ->with(implode('.', array_slice($depSeq, 1))); |
179 | 179 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | implode(',', [$component['childField'], $component['parentField']]), |
213 | 213 | $component['join'], |
214 | 214 | [ |
215 | - $component['parentField'] . ' IN (' . implode(',', $data) . ')' |
|
215 | + $component['parentField'].' IN ('.implode(',', $data).')' |
|
216 | 216 | ] |
217 | 217 | )->execute(); |
218 | 218 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
232 | - if (count($depSeq)>1) { |
|
232 | + if (count($depSeq) > 1) { |
|
233 | 233 | $result = $result |
234 | 234 | ->with(implode('.', array_slice($depSeq, 1))); |
235 | 235 | } |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | } |
270 | 270 | if (!method_exists($item, 'addEagerRelation')) { |
271 | 271 | throw new EagerLoadingException( |
272 | - "Model {$item->ClassName} must include " . |
|
273 | - EagerLoaderMultiAccessor::class . |
|
272 | + "Model {$item->ClassName} must include ". |
|
273 | + EagerLoaderMultiAccessor::class. |
|
274 | 274 | " trait to use eager loading for \$has_many" |
275 | 275 | ); |
276 | 276 | } |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | } |
293 | 293 | if (!method_exists($item, 'addEagerRelation')) { |
294 | 294 | throw new EagerLoadingException( |
295 | - "Model {$item->ClassName} must include " . |
|
296 | - EagerLoaderMultiAccessor::class . |
|
295 | + "Model {$item->ClassName} must include ". |
|
296 | + EagerLoaderMultiAccessor::class. |
|
297 | 297 | " trait to use eager loading for \$many_many" |
298 | 298 | ); |
299 | 299 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function updateProxy(ProxyGenerator &$proxy) |
24 | 24 | { |
25 | 25 | // In the closure, $this is the proxied database |
26 | - $callback = function ($args, $next) { |
|
26 | + $callback = function($args, $next) { |
|
27 | 27 | |
28 | 28 | // The first argument is always the sql query |
29 | 29 | $sql = $args[0]; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $this->autoFollowRedirection = false; |
39 | 39 | $this->logInAs('admin'); |
40 | - $this->assertTrue((bool)Permission::check("ADMIN")); |
|
40 | + $this->assertTrue((bool) Permission::check("ADMIN")); |
|
41 | 41 | $this->assertEquals(200, $this->get('admin/eltestadmin')->getStatusCode()); |
42 | 42 | } |
43 | 43 | |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | $exportActionStateID = $this->getActionSessionKey('export'); |
67 | 67 | $exportActionText = _t('SilverStripe\\Forms\\GridField\\GridField.CSVEXPORT', 'Export to CSV'); |
68 | 68 | $getVars = [ |
69 | - 'action_gridFieldAlterAction?StateID=' . $exportActionStateID => $exportActionText, |
|
69 | + 'action_gridFieldAlterAction?StateID='.$exportActionStateID => $exportActionText, |
|
70 | 70 | ]; |
71 | 71 | |
72 | 72 | $this->autoFollowRedirection = false; |
73 | 73 | $this->logInAs('admin'); |
74 | - $this->assertTrue((bool)Permission::check("ADMIN")); |
|
74 | + $this->assertTrue((bool) Permission::check("ADMIN")); |
|
75 | 75 | $modelClassName = "Gurucomkz-EagerLoading-Tests-Models-Player"; |
76 | - $getLink = "admin/eltestadmin/$modelClassName/EditForm/field/$modelClassName?" . http_build_query($getVars); |
|
76 | + $getLink = "admin/eltestadmin/$modelClassName/EditForm/field/$modelClassName?".http_build_query($getVars); |
|
77 | 77 | |
78 | 78 | $this->assertEquals(200, $this->get($getLink)->getStatusCode()); |
79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | preg_match_all('/"action_gridFieldAlterAction\?StateID=([^"]+)"/', $body, $matches); |
91 | 91 | |
92 | 92 | /** @var StateStore $store */ |
93 | - $store = Injector::inst()->create(StateStore::class . '.' . 'Gurucomkz-EagerLoading-Tests-Models-Player'); |
|
93 | + $store = Injector::inst()->create(StateStore::class.'.'.'Gurucomkz-EagerLoading-Tests-Models-Player'); |
|
94 | 94 | |
95 | 95 | foreach ($matches[1] as $actionCode) { |
96 | 96 | $actionData = $store->load($actionCode); |