@@ -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(implode(',', $fields), [$table], ["ID IN (" . implode(',', $ids) . ")"]); |
|
| 126 | + $data = new SQLSelect(implode(',', $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 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | implode(',', [$component['childField'], $component['parentField']]), |
| 212 | 212 | $component['join'], |
| 213 | 213 | [ |
| 214 | - $component['parentField'] . ' IN (' . implode(',', $data) . ')' |
|
| 214 | + $component['parentField'].' IN ('.implode(',', $data).')' |
|
| 215 | 215 | ] |
| 216 | 216 | )->execute(); |
| 217 | 217 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
| 231 | - if (count($depSeq)>1) { |
|
| 231 | + if (count($depSeq) > 1) { |
|
| 232 | 232 | $result = $result |
| 233 | 233 | ->with(implode('.', array_slice($depSeq, 1))); |
| 234 | 234 | } |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | if (!method_exists($item, 'addEagerRelation')) { |
| 270 | 270 | throw new EagerLoadingException( |
| 271 | - "Model {$item->ClassName} must include " . |
|
| 272 | - EagerLoaderMultiAccessor::class . |
|
| 271 | + "Model {$item->ClassName} must include ". |
|
| 272 | + EagerLoaderMultiAccessor::class. |
|
| 273 | 273 | " trait to use eager loading for \$has_many" |
| 274 | 274 | ); |
| 275 | 275 | } |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | if (!method_exists($item, 'addEagerRelation')) { |
| 293 | 293 | throw new EagerLoadingException( |
| 294 | - "Model {$item->ClassName} must include " . |
|
| 295 | - EagerLoaderMultiAccessor::class . |
|
| 294 | + "Model {$item->ClassName} must include ". |
|
| 295 | + EagerLoaderMultiAccessor::class. |
|
| 296 | 296 | " trait to use eager loading for \$many_many" |
| 297 | 297 | ); |
| 298 | 298 | } |