@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public static function get_base_phrase(string $phrase): string |
55 | 55 | { |
56 | - if (! in_array($phrase, ['add', 'review', 'edit', 'more'])) { |
|
56 | + if (!in_array($phrase, ['add', 'review', 'edit', 'more'])) { |
|
57 | 57 | user_error('Phrase must be one of "add", "review", or "edit"', E_USER_ERROR); |
58 | 58 | } |
59 | 59 | $phrase = Config::inst()->get(static::class, $phrase . '_phrase'); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | usort( |
186 | 186 | $shortcuts, |
187 | - function ($a, $b) { |
|
187 | + function($a, $b) { |
|
188 | 188 | $b['SortOrder'] ?? 0; |
189 | 189 | $a['SortOrder'] ?? 0; |
190 | 190 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | |
193 | 193 | foreach ($shortcuts as $groupCode => $groupDetails) { |
194 | 194 | $colour = ''; |
195 | - if (! empty($groupDetails['Colour'])) { |
|
195 | + if (!empty($groupDetails['Colour'])) { |
|
196 | 196 | $colour = 'style="background-color: ' . $groupDetails['Colour'] . '"'; |
197 | 197 | } |
198 | 198 | $icon = ''; |
199 | - if (! empty($groupDetails['IconClass'])) { |
|
199 | + if (!empty($groupDetails['IconClass'])) { |
|
200 | 200 | $icon = '<i class="' . $groupDetails['IconClass'] . '"></i> '; |
201 | 201 | } |
202 | 202 | $html .= ' |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | </div> |
207 | 207 | <div class="entries">'; |
208 | 208 | $items = $groupDetails['Items'] ?? []; |
209 | - if (! empty($entry['Link']) && class_exists($entry['Link'])) { |
|
209 | + if (!empty($entry['Link']) && class_exists($entry['Link'])) { |
|
210 | 210 | $obj = Injector::inst()->get($entry['Link']); |
211 | 211 | if ($obj instanceof DataObject) { |
212 | 212 | $entry['Link'] = DataObject::get_one($entry['Link'])->CMSEditLink(); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | return $array; |
269 | 269 | } |
270 | 270 | |
271 | - protected function makeShortCut(array $entry, ?bool $isInsideLink = false): LiteralField|string |
|
271 | + protected function makeShortCut(array $entry, ?bool $isInsideLink = false): LiteralField | string |
|
272 | 272 | { |
273 | 273 | $title = (string) $entry['Title']; |
274 | 274 | $link = (string) $entry['Link']; |
@@ -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']; |