@@ -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 |
@@ -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 = DataObject::getSchema()->tableName($this->dataClass); |
| 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 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | 'map' => [], |
| 179 | 179 | ]; |
| 180 | 180 | $result = DataObject::get($depClass)->filter($depKey, $data); |
| 181 | - if (count($depSeq)>1) { |
|
| 181 | + if (count($depSeq) > 1) { |
|
| 182 | 182 | $result = $result |
| 183 | 183 | ->with(implode('.', array_slice($depSeq, 1))); |
| 184 | 184 | } |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $idsQuery = SQLSelect::create( |
| 217 | 217 | [ |
| 218 | - '"' . $component['childField'] . '"', |
|
| 219 | - '"' . $component['parentField'] . '"', |
|
| 218 | + '"'.$component['childField'].'"', |
|
| 219 | + '"'.$component['parentField'].'"', |
|
| 220 | 220 | ], |
| 221 | - '"' . $component['join'] . '"', |
|
| 221 | + '"'.$component['join'].'"', |
|
| 222 | 222 | [ |
| 223 | - '"' . $component['parentField'] . '" IN (' . implode(',', $data) . ')' |
|
| 223 | + '"'.$component['parentField'].'" IN ('.implode(',', $data).')' |
|
| 224 | 224 | ] |
| 225 | 225 | )->execute(); |
| 226 | 226 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted)); |
| 240 | - if (count($depSeq)>1) { |
|
| 240 | + if (count($depSeq) > 1) { |
|
| 241 | 241 | $result = $result |
| 242 | 242 | ->with(implode('.', array_slice($depSeq, 1))); |
| 243 | 243 | } |
@@ -277,8 +277,8 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | if (!method_exists($item, 'addEagerRelation')) { |
| 279 | 279 | throw new EagerLoadingException( |
| 280 | - "Model {$item->ClassName} must include " . |
|
| 281 | - EagerLoaderMultiAccessor::class . |
|
| 280 | + "Model {$item->ClassName} must include ". |
|
| 281 | + EagerLoaderMultiAccessor::class. |
|
| 282 | 282 | " trait to use eager loading for \$has_many" |
| 283 | 283 | ); |
| 284 | 284 | } |
@@ -300,8 +300,8 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | if (!method_exists($item, 'addEagerRelation')) { |
| 302 | 302 | throw new EagerLoadingException( |
| 303 | - "Model {$item->ClassName} must include " . |
|
| 304 | - EagerLoaderMultiAccessor::class . |
|
| 303 | + "Model {$item->ClassName} must include ". |
|
| 304 | + EagerLoaderMultiAccessor::class. |
|
| 305 | 305 | " trait to use eager loading for \$many_many" |
| 306 | 306 | ); |
| 307 | 307 | } |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | protected static $queries = []; |
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public function updateProxy(ProxyGenerator &$proxy) |
|
| 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]; |