diff --git a/modules/backend/traits/CollapsableWidget.php b/modules/backend/traits/CollapsableWidget.php index bab12cf07..737ec4a13 100644 --- a/modules/backend/traits/CollapsableWidget.php +++ b/modules/backend/traits/CollapsableWidget.php @@ -26,12 +26,14 @@ trait CollapsableWidget protected function getGroupStatuses() { - if ($this->groupStatusCache !== false) + if ($this->groupStatusCache !== false) { return $this->groupStatusCache; + } $groups = $this->getSession('groups', []); - if (!is_array($groups)) + if (!is_array($groups)) { return $this->groupStatusCache = []; + } return $this->groupStatusCache = $groups; } @@ -47,9 +49,10 @@ trait CollapsableWidget protected function getGroupStatus($group) { $statuses = $this->getGroupStatuses(); - if (array_key_exists($group, $statuses)) + if (array_key_exists($group, $statuses)) { return $statuses[$group]; + } return true; } -} \ No newline at end of file +} diff --git a/modules/backend/traits/InspectableContainer.php b/modules/backend/traits/InspectableContainer.php index 3b6eb64ca..e24f6b3e9 100644 --- a/modules/backend/traits/InspectableContainer.php +++ b/modules/backend/traits/InspectableContainer.php @@ -17,24 +17,28 @@ trait InspectableContainer public function onInspectableGetOptions() { $property = trim(Request::input('inspectorProperty')); - if (!$property) + if (!$property) { throw new ApplicationException('The property name is not specified.'); + } $className = trim(Request::input('inspectorClassName')); - if (!$className) + if (!$className) { throw new ApplicationException('The inspectable class name is not specified.'); + } $traitFound = in_array('System\Traits\PropertyContainer', class_uses_recursive($className)); - if (!$traitFound) + if (!$traitFound) { throw new ApplicationException('The options cannot be loaded for the specified class.'); + } $obj = new $className(null); $methodName = 'get'.ucfirst($property).'Options'; - if (method_exists($obj, $methodName)) + if (method_exists($obj, $methodName)) { $options = $obj->$methodName(); - else + } else { $options = $obj->getPropertyOptions($property); + } /* * Convert to array to retain the sort order in JavaScript @@ -48,4 +52,4 @@ trait InspectableContainer 'options' => $optionsArray ]; } -} \ No newline at end of file +} diff --git a/modules/backend/traits/SearchableWidget.php b/modules/backend/traits/SearchableWidget.php index c0cee99f7..50fe79da9 100644 --- a/modules/backend/traits/SearchableWidget.php +++ b/modules/backend/traits/SearchableWidget.php @@ -33,13 +33,15 @@ trait SearchableWidget { foreach ($words as $word) { $word = trim($word); - if (!strlen($word)) + if (!strlen($word)) { continue; + } - if (Str::contains(Str::lower($text), $word)) + if (Str::contains(Str::lower($text), $word)) { return true; + } } return false; } -} \ No newline at end of file +} diff --git a/modules/backend/traits/SelectableWidget.php b/modules/backend/traits/SelectableWidget.php index 855dbc2ea..a46ff130e 100644 --- a/modules/backend/traits/SelectableWidget.php +++ b/modules/backend/traits/SelectableWidget.php @@ -28,12 +28,14 @@ trait SelectableWidget protected function getSelectedItems() { - if ($this->selectedItemsCache !== false) + if ($this->selectedItemsCache !== false) { return $this->selectedItemsCache; + } $items = $this->getSession('selected', []); - if (!is_array($items)) + if (!is_array($items)) { return $this->selectedItemsCache = []; + } return $this->selectedItemsCache = $items; } @@ -54,9 +56,10 @@ trait SelectableWidget protected function isItemSelected($itemId) { $selectedItems = $this->getSelectedItems(); - if (!is_array($selectedItems) || !isset($selectedItems[$itemId])) + if (!is_array($selectedItems) || !isset($selectedItems[$itemId])) { return false; + } return $selectedItems[$itemId]; } -} \ No newline at end of file +} diff --git a/modules/backend/traits/WidgetMaker.php b/modules/backend/traits/WidgetMaker.php index e5a70ea89..d67540746 100644 --- a/modules/backend/traits/WidgetMaker.php +++ b/modules/backend/traits/WidgetMaker.php @@ -29,4 +29,4 @@ trait WidgetMaker $widget = $manager->makeWidget($class, $controller, $configuration); return $widget; } -} \ No newline at end of file +}