@@ -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 |
@@ -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); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | return array_filter( |
66 | 66 | $this->withList, |
67 | - function ($dep) use ($list) { |
|
67 | + function($dep) use ($list) { |
|
68 | 68 | return array_key_exists($dep[0], $list); |
69 | 69 | } |
70 | 70 | ); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $fields[] = "\"{$dep}ID\""; |
124 | 124 | } |
125 | 125 | $table = Config::forClass($this->dataClass)->get('table_name'); |
126 | - $data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']); |
|
126 | + $data = new SQLSelect($fields, '"'.$table.'"', ['"ID" IN ('.implode(',', $ids).')']); |
|
127 | 127 | $data = Utils::EnsureArray($data->execute(), 'ID'); |
128 | 128 | |
129 | 129 | foreach ($withHasOnes as $depSeq) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | while (count($uniqueIDs)) { |
142 | 142 | $IDsubset = array_splice($uniqueIDs, 0, self::ID_LIMIT); |
143 | 143 | $result = DataObject::get($depClass)->filter('ID', $IDsubset); |
144 | - if (count($depSeq)>1) { |
|
144 | + if (count($depSeq) > 1) { |
|
145 | 145 | $result = $result |
146 | 146 | ->with(implode('.', array_slice($depSeq, 1))); |
147 | 147 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | 'map' => [], |
173 | 173 | ]; |
174 | 174 | $result = DataObject::get($depClass)->filter($depKey, $data); |
175 | - if (count($depSeq)>1) { |
|
175 | + if (count($depSeq) > 1) { |
|
176 | 176 | $result = $result |
177 | 177 | ->with(implode('.', array_slice($depSeq, 1))); |
178 | 178 | } |
@@ -209,12 +209,12 @@ discard block |
||
209 | 209 | |
210 | 210 | $idsQuery = SQLSelect::create( |
211 | 211 | [ |
212 | - '"' . $component['childField'] . '"', |
|
213 | - '"' . $component['parentField'] . '"', |
|
212 | + '"'.$component['childField'].'"', |
|
213 | + '"'.$component['parentField'].'"', |
|
214 | 214 | ], |
215 | - '"' . $component['join'] . '"', |
|
215 | + '"'.$component['join'].'"', |
|
216 | 216 | [ |
217 | - '"' . $component['parentField'] . '" IN (' . implode(',', $data) . ')' |
|
217 | + '"'.$component['parentField'].'" IN ('.implode(',', $data).')' |
|
218 | 218 | ] |
219 | 219 | )->execute(); |
220 | 220 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
234 | - if (count($depSeq)>1) { |
|
234 | + if (count($depSeq) > 1) { |
|
235 | 235 | $result = $result |
236 | 236 | ->with(implode('.', array_slice($depSeq, 1))); |
237 | 237 | } |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | } |
272 | 272 | if (!method_exists($item, 'addEagerRelation')) { |
273 | 273 | throw new EagerLoadingException( |
274 | - "Model {$item->ClassName} must include " . |
|
275 | - EagerLoaderMultiAccessor::class . |
|
274 | + "Model {$item->ClassName} must include ". |
|
275 | + EagerLoaderMultiAccessor::class. |
|
276 | 276 | " trait to use eager loading for \$has_many" |
277 | 277 | ); |
278 | 278 | } |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | } |
295 | 295 | if (!method_exists($item, 'addEagerRelation')) { |
296 | 296 | throw new EagerLoadingException( |
297 | - "Model {$item->ClassName} must include " . |
|
298 | - EagerLoaderMultiAccessor::class . |
|
297 | + "Model {$item->ClassName} must include ". |
|
298 | + EagerLoaderMultiAccessor::class. |
|
299 | 299 | " trait to use eager loading for \$many_many" |
300 | 300 | ); |
301 | 301 | } |