@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | public function isObjCreatable() |
| 839 | 839 | { |
| 840 | 840 | $model = $this->proto(); |
| 841 | - $method = [ $model, 'isCreatable' ]; |
|
| 841 | + $method = [$model, 'isCreatable']; |
|
| 842 | 842 | |
| 843 | 843 | if (is_callable($method)) { |
| 844 | 844 | return call_user_func($method); |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | public function isObjEditable() |
| 859 | 859 | { |
| 860 | 860 | $model = ($this->currentObj) ? $this->currentObj : $this->proto(); |
| 861 | - $method = [ $model, 'isEditable' ]; |
|
| 861 | + $method = [$model, 'isEditable']; |
|
| 862 | 862 | |
| 863 | 863 | if (is_callable($method)) { |
| 864 | 864 | return call_user_func($method); |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | public function isObjDeletable() |
| 879 | 879 | { |
| 880 | 880 | $model = ($this->currentObj) ? $this->currentObj : $this->proto(); |
| 881 | - $method = [ $model, 'isDeletable' ]; |
|
| 881 | + $method = [$model, 'isDeletable']; |
|
| 882 | 882 | |
| 883 | 883 | if (is_callable($method)) { |
| 884 | 884 | return call_user_func($method); |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | return false; |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | - $method = [ $model, 'isViewable' ]; |
|
| 905 | + $method = [$model, 'isViewable']; |
|
| 906 | 906 | if (is_callable($method)) { |
| 907 | 907 | return call_user_func($method); |
| 908 | 908 | } |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | if (is_string($toResolve)) { |
| 996 | 996 | $model = $this->proto(); |
| 997 | 997 | |
| 998 | - $resolved = [ $model, $toResolve ]; |
|
| 998 | + $resolved = [$model, $toResolve]; |
|
| 999 | 999 | |
| 1000 | 1000 | // check for slim callable as "class:method" |
| 1001 | 1001 | $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | $method = $matches[2]; |
| 1005 | 1005 | |
| 1006 | 1006 | if ($class === 'parent') { |
| 1007 | - $resolved = [ $model, $class.'::'.$method ]; |
|
| 1007 | + $resolved = [$model, $class.'::'.$method]; |
|
| 1008 | 1008 | } |
| 1009 | 1009 | } |
| 1010 | 1010 | |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | } |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - usort($listActions, [ $this, 'sortActionsByPriority' ]); |
|
| 1097 | + usort($listActions, [$this, 'sortActionsByPriority']); |
|
| 1098 | 1098 | |
| 1099 | 1099 | while (($first = reset($listActions)) && $first['isSeparator']) { |
| 1100 | 1100 | array_shift($listActions); |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | 'ident' => 'edit', |
| 1136 | 1136 | 'priority' => 1 |
| 1137 | 1137 | ]; |
| 1138 | - $this->defaultObjectActions = [ $edit ]; |
|
| 1138 | + $this->defaultObjectActions = [$edit]; |
|
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | 1141 | return $this->defaultObjectActions; |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | unset($object); |
| 1231 | 1231 | |
| 1232 | 1232 | $ident = $property->ident(); |
| 1233 | - $classes = [ sprintf('property-%s', $ident) ]; |
|
| 1233 | + $classes = [sprintf('property-%s', $ident)]; |
|
| 1234 | 1234 | $options = $this->viewOptions($ident); |
| 1235 | 1235 | |
| 1236 | 1236 | if (isset($options['classes'])) { |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | 'class' => [] |
| 1264 | 1264 | ]; |
| 1265 | 1265 | |
| 1266 | - $method = [ $object, 'isActiveTableRow' ]; |
|
| 1266 | + $method = [$object, 'isActiveTableRow']; |
|
| 1267 | 1267 | if (is_callable($method)) { |
| 1268 | 1268 | if (call_user_func($method)) { |
| 1269 | 1269 | $row['attr']['class'][] = 'active'; |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | 'active' => $active, |
| 422 | 422 | 'name' => $name, |
| 423 | 423 | 'url' => $url, |
| 424 | - 'selected' => $this->isCurrentItem([ $linkIdent, (string)$url ]), |
|
| 424 | + 'selected' => $this->isCurrentItem([$linkIdent, (string)$url]), |
|
| 425 | 425 | 'required_acl_permissions' => $permissions |
| 426 | 426 | ]; |
| 427 | 427 | } else { |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | public function displayAsPanel() |
| 528 | 528 | { |
| 529 | - return in_array($this->displayType(), [ 'panel', 'collapsible' ]); |
|
| 529 | + return in_array($this->displayType(), ['panel', 'collapsible']); |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /** |
@@ -632,10 +632,10 @@ discard block |
||
| 632 | 632 | $this->addGroup($groupIdent, $group); |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | - uasort($this->groups, [ $this, 'sortGroupsByPriority' ]); |
|
| 635 | + uasort($this->groups, [$this, 'sortGroupsByPriority']); |
|
| 636 | 636 | |
| 637 | 637 | // Remove items that are not active. |
| 638 | - $this->groups = array_filter($this->groups, function($item) { |
|
| 638 | + $this->groups = array_filter($this->groups, function ($item) { |
|
| 639 | 639 | return ($item->active()); |
| 640 | 640 | }); |
| 641 | 641 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | */ |
| 431 | 431 | public function navContainerCssClasses() |
| 432 | 432 | { |
| 433 | - $classes = [ 'has-nav-logo' ]; |
|
| 433 | + $classes = ['has-nav-logo']; |
|
| 434 | 434 | |
| 435 | 435 | if ($this->showMainMenu()) { |
| 436 | 436 | $classes[] = 'has-nav-main'; |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | return false; |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | - return (!empty($recaptcha['public_key']) || !empty($recaptcha['key'])) && |
|
| 554 | + return (!empty($recaptcha['public_key']) || !empty($recaptcha['key'])) && |
|
| 555 | 555 | (!empty($recaptcha['private_key']) || !empty($recaptcha['secret'])); |
| 556 | 556 | } |
| 557 | 557 | |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | |
| 946 | 946 | if (!empty($menuItem['url'])) { |
| 947 | 947 | $url = $menuItem['url']; |
| 948 | - if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) { |
|
| 948 | + if ($url && strpos($url, ':') === false && !in_array($url[0], ['/', '#', '?'])) { |
|
| 949 | 949 | $url = $this->adminUrl().$url; |
| 950 | 950 | } |
| 951 | 951 | } else { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | if (isset($menuItem['icon'])) { |
| 958 | 958 | $icon = $menuItem['icon']; |
| 959 | - if ($icon && strpos($icon, ':') === false && !in_array($icon[0], [ '/', '#', '?' ])) { |
|
| 959 | + if ($icon && strpos($icon, ':') === false && !in_array($icon[0], ['/', '#', '?'])) { |
|
| 960 | 960 | $icon = $svgUri.$icon; |
| 961 | 961 | } |
| 962 | 962 | } else { |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | /** Extract the secondary menu widget related to this main menu item. */ |
| 986 | 986 | $secondaryMenuWidget = current( |
| 987 | 987 | array_filter( |
| 988 | - $this->secondaryMenu(), function($item) use ($menuIdent) { |
|
| 988 | + $this->secondaryMenu(), function ($item) use ($menuIdent) { |
|
| 989 | 989 | return $item->ident() === $menuIdent; |
| 990 | 990 | } |
| 991 | 991 | ) |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | |
| 1014 | 1014 | if (!empty($menuItem['url'])) { |
| 1015 | 1015 | $url = $menuItem['url']; |
| 1016 | - if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) { |
|
| 1016 | + if ($url && strpos($url, ':') === false && !in_array($url[0], ['/', '#', '?'])) { |
|
| 1017 | 1017 | $url = $this->adminUrl().$url; |
| 1018 | 1018 | } |
| 1019 | 1019 | } else { |
@@ -1104,7 +1104,7 @@ discard block |
||
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | $value = str_replace( |
| 1107 | - [ 'abstract', 'trait', 'interface', 'template', '\\' ], |
|
| 1107 | + ['abstract', 'trait', 'interface', 'template', '\\'], |
|
| 1108 | 1108 | '', |
| 1109 | 1109 | $value |
| 1110 | 1110 | ); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | return $this; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - $isSelected = $this->secondaryMenu()->isCurrentItem([ $linkIdent, (string)$url ]); |
|
| 230 | + $isSelected = $this->secondaryMenu()->isCurrentItem([$linkIdent, (string)$url]); |
|
| 231 | 231 | |
| 232 | 232 | if ($isSelected) { |
| 233 | 233 | $this->isSelected(true); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | public function displayAsPanel() |
| 350 | 350 | { |
| 351 | - return in_array($this->displayType(), [ 'panel', 'collapsible' ]); |
|
| 351 | + return in_array($this->displayType(), ['panel', 'collapsible']); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /** |