@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | $title = $title['title']; |
255 | 255 | $model = $title['dataClass'] ?? $model; |
256 | 256 | } |
257 | - if (! class_exists($model)) { |
|
257 | + if (!class_exists($model)) { |
|
258 | 258 | continue; |
259 | 259 | } |
260 | 260 | $obj = Injector::inst()->get($model); |
261 | 261 | if ($obj && $obj->canView()) { |
262 | - if (! $groupAdded) { |
|
262 | + if (!$groupAdded) { |
|
263 | 263 | DashboardWelcomeQuicklinks::add_group($groupCode, $ma->menu_title(), 100); |
264 | 264 | $groupAdded = true; |
265 | 265 | } |
@@ -267,14 +267,14 @@ discard block |
||
267 | 267 | $ma = ReflectionHelper::allowAccessToProperty(get_class($ma), 'modelClass'); |
268 | 268 | $ma->modelClass = $model; |
269 | 269 | $list = $ma->getList(); |
270 | - if (! $list) { |
|
270 | + if (!$list) { |
|
271 | 271 | $list = $model::get(); |
272 | 272 | } |
273 | 273 | $objectCount = $list->count(); |
274 | 274 | if ($objectCount === 1) { |
275 | 275 | $baseTable = Injector::inst()->get($model)->baseTable(); |
276 | 276 | $obj = DataObject::get_one($model, [$baseTable . '.ClassName' => $model]); |
277 | - if (! $obj) { |
|
277 | + if (!$obj) { |
|
278 | 278 | $obj = DataObject::get_one($model); |
279 | 279 | } |
280 | 280 | if ($obj && $obj->hasMethod('CMSEditLink')) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $link = ''; |
290 | 290 | if ($obj->hasMethod('CMSListLink')) { |
291 | 291 | $link = $obj->CMSListLink(); |
292 | - } if (! $link) { |
|
292 | + } if (!$link) { |
|
293 | 293 | $link = $ma->getLinkForModelTab($model); |
294 | 294 | } |
295 | 295 | $titleContainsObjectCount = strpos($title, ' (' . $objectCount . ')'); |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | |
329 | 329 | protected function sortByCountAndTitle(array $array): array |
330 | 330 | { |
331 | - usort($array, function ($a, $b) { |
|
331 | + usort($array, function($a, $b) { |
|
332 | 332 | $countComparison = $b['Count'] <=> $a['Count']; |
333 | 333 | if ($countComparison === 0) { |
334 | 334 | return $a['Title'] <=> $b['Title']; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public static function get_base_phrase(string $phrase): string |
60 | 60 | { |
61 | - if (! in_array($phrase, ['add', 'review', 'edit', 'more'])) { |
|
61 | + if (!in_array($phrase, ['add', 'review', 'edit', 'more'])) { |
|
62 | 62 | user_error('Phrase must be one of "add", "review", or "edit"', E_USER_ERROR); |
63 | 63 | } |
64 | 64 | $phrase = Config::inst()->get(static::class, $phrase . '_phrase'); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | usort( |
191 | 191 | $shortcuts, |
192 | - function ($a, $b) { |
|
192 | + function($a, $b) { |
|
193 | 193 | $b['SortOrder'] ?? 0; |
194 | 194 | $a['SortOrder'] ?? 0; |
195 | 195 | } |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | |
198 | 198 | foreach ($shortcuts as $groupCode => $groupDetails) { |
199 | 199 | $colour = ''; |
200 | - if (! empty($groupDetails['Colour'])) { |
|
200 | + if (!empty($groupDetails['Colour'])) { |
|
201 | 201 | $colour = 'style="background-color: ' . $groupDetails['Colour'] . '"'; |
202 | 202 | } |
203 | 203 | $icon = ''; |
204 | - if (! empty($groupDetails['IconClass'])) { |
|
204 | + if (!empty($groupDetails['IconClass'])) { |
|
205 | 205 | $icon = '<i class="' . $groupDetails['IconClass'] . '"></i> '; |
206 | 206 | } |
207 | 207 | $html .= ' |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | <div class="entries">'; |
213 | 213 | $items = $groupDetails['Items'] ?? []; |
214 | 214 | foreach ($items as $pos => $entry) { |
215 | - if (! empty($entry['Link']) && class_exists($entry['Link'])) { |
|
215 | + if (!empty($entry['Link']) && class_exists($entry['Link'])) { |
|
216 | 216 | $obj = Injector::inst()->get($entry['Link']); |
217 | 217 | if ($obj instanceof DataObject) { |
218 | 218 | $entry['Link'] = DataObject::get_one($entry['Link'])->CMSEditLink(); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | return $array; |
276 | 276 | } |
277 | 277 | |
278 | - protected function makeShortCut(array $entry, ?bool $isInsideLink = false): LiteralField|string |
|
278 | + protected function makeShortCut(array $entry, ?bool $isInsideLink = false): LiteralField | string |
|
279 | 279 | { |
280 | 280 | $title = (string) $entry['Title']; |
281 | 281 | $link = (string) $entry['Link']; |