diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php index 7462124d8..1efe1a443 100644 --- a/modules/backend/behaviors/FormController.php +++ b/modules/backend/behaviors/FormController.php @@ -472,7 +472,7 @@ class FormController extends ControllerBehavior $redirect = Redirect::to($redirectUrl); } else { // Process relative redirects - $redirect = ($redirectUrl) ? Backend::redirect($redirectUrl) : null; + $redirect = $redirectUrl ? Backend::redirect($redirectUrl) : null; } return $redirect; diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 389f2f77b..2781302ef 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -421,7 +421,7 @@ class RelationController extends ControllerBehavior /* * Determine the partial to use based on the supplied section option */ - $section = (isset($options['section'])) ? $options['section'] : null; + $section = isset($options['section']) ? $options['section'] : null; switch (strtolower($section)) { case 'toolbar': return $this->toolbarWidget ? $this->toolbarWidget->render() : null; diff --git a/modules/backend/classes/BackendController.php b/modules/backend/classes/BackendController.php index 4330761c6..1a77aa8c8 100644 --- a/modules/backend/classes/BackendController.php +++ b/modules/backend/classes/BackendController.php @@ -136,7 +136,7 @@ class BackendController extends ControllerBase $controller = Str::normalizeClassName($controller); $controllerFile = $inPath.strtolower(str_replace('\\', '/', $controller)) . '.php'; if ($controllerFile = File::existsInsensitive($controllerFile)) { - include_once($controllerFile); + include_once $controllerFile; } } diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index 24f0b6663..1cfece561 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -520,7 +520,7 @@ class Controller extends Extendable if (($widget = $this->widget->{$widgetName}) && $widget->methodExists($handlerName)) { $result = $this->runAjaxHandlerForWidget($widget, $handlerName); - return ($result) ?: true; + return $result ?: true; } } else { @@ -531,7 +531,7 @@ class Controller extends Extendable if ($this->methodExists($pageHandler)) { $result = call_user_func_array([$this, $pageHandler], $this->params); - return ($result) ?: true; + return $result ?: true; } /* @@ -539,7 +539,7 @@ class Controller extends Extendable */ if ($this->methodExists($handler)) { $result = call_user_func_array([$this, $handler], $this->params); - return ($result) ?: true; + return $result ?: true; } /* @@ -551,7 +551,7 @@ class Controller extends Extendable foreach ((array) $this->widget as $widget) { if ($widget->methodExists($handler)) { $result = $this->runAjaxHandlerForWidget($widget, $handler); - return ($result) ?: true; + return $result ?: true; } } } diff --git a/modules/backend/classes/WidgetBase.php b/modules/backend/classes/WidgetBase.php index 468f56d81..31479a726 100644 --- a/modules/backend/classes/WidgetBase.php +++ b/modules/backend/classes/WidgetBase.php @@ -65,7 +65,7 @@ abstract class WidgetBase extends Extendable * If no alias is set by the configuration. */ if (!isset($this->alias)) { - $this->alias = (isset($this->config->alias)) ? $this->config->alias : $this->defaultAlias; + $this->alias = isset($this->config->alias) ? $this->config->alias : $this->defaultAlias; } /* diff --git a/modules/backend/formwidgets/FileUpload.php b/modules/backend/formwidgets/FileUpload.php index 3d36cb2ae..589ef468b 100644 --- a/modules/backend/formwidgets/FileUpload.php +++ b/modules/backend/formwidgets/FileUpload.php @@ -207,20 +207,20 @@ class FileUpload extends FormWidgetBase $cssDimensions = ''; if ($mode == 'block') { - $cssDimensions .= ($this->imageWidth) + $cssDimensions .= $this->imageWidth ? 'width: '.$this->imageWidth.'px;' : 'width: '.$this->imageHeight.'px;'; - $cssDimensions .= ($this->imageHeight) + $cssDimensions .= $this->imageHeight ? 'height: '.$this->imageHeight.'px;' : 'height: auto;'; } else { - $cssDimensions .= ($this->imageWidth) + $cssDimensions .= $this->imageWidth ? 'width: '.$this->imageWidth.'px;' : 'width: auto;'; - $cssDimensions .= ($this->imageHeight) + $cssDimensions .= $this->imageHeight ? 'height: '.$this->imageHeight.'px;' : 'height: auto;'; } diff --git a/modules/backend/widgets/Filter.php b/modules/backend/widgets/Filter.php index a1e155ec7..898d2466f 100644 --- a/modules/backend/widgets/Filter.php +++ b/modules/backend/widgets/Filter.php @@ -524,7 +524,7 @@ class Filter extends WidgetBase * Check that the filter scope matches the active context */ if ($scopeObj->context !== null) { - $context = (is_array($scopeObj->context)) ? $scopeObj->context : [$scopeObj->context]; + $context = is_array($scopeObj->context) ? $scopeObj->context : [$scopeObj->context]; if (!in_array($this->getContext(), $context)) { continue; } @@ -584,7 +584,7 @@ class Filter extends WidgetBase */ protected function makeFilterScope($name, $config) { - $label = (isset($config['label'])) ? $config['label'] : null; + $label = isset($config['label']) ? $config['label'] : null; $scopeType = isset($config['type']) ? $config['type'] : null; $scope = new FilterScope($name, $label); diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index 901e34292..1852ee751 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -550,7 +550,7 @@ class Form extends WidgetBase * Check that the form field matches the active context */ if ($fieldObj->context !== null) { - $context = (is_array($fieldObj->context)) ? $fieldObj->context : [$fieldObj->context]; + $context = is_array($fieldObj->context) ? $fieldObj->context : [$fieldObj->context]; if (!in_array($this->getContext(), $context)) { continue; } @@ -643,7 +643,7 @@ class Form extends WidgetBase */ protected function makeFormField($name, $config = []) { - $label = (isset($config['label'])) ? $config['label'] : null; + $label = isset($config['label']) ? $config['label'] : null; list($fieldName, $fieldContext) = $this->getFieldName($name); $field = new FormField($fieldName, $label); diff --git a/modules/cms/classes/ComponentHelpers.php b/modules/cms/classes/ComponentHelpers.php index bdb44a589..703327ecd 100644 --- a/modules/cms/classes/ComponentHelpers.php +++ b/modules/cms/classes/ComponentHelpers.php @@ -106,7 +106,7 @@ class ComponentHelpers public static function getComponentName($component) { $details = $component->componentDetails(); - $name = (isset($details['name'])) + $name = isset($details['name']) ? $details['name'] : 'cms::lang.component.unnamed'; @@ -121,7 +121,7 @@ class ComponentHelpers public static function getComponentDescription($component) { $details = $component->componentDetails(); - $name = (isset($details['description'])) + $name = isset($details['description']) ? $details['description'] : 'cms::lang.component.no_description'; diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 91294c7b5..259145029 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -332,7 +332,7 @@ class Controller if ( $useAjax && ($handler = post('_handler')) && - ($this->verifyCsrfToken()) && + $this->verifyCsrfToken() && ($handlerResponse = $this->runAjaxHandler($handler)) && $handlerResponse !== true ) { @@ -717,7 +717,7 @@ class Controller if ($componentObj && $componentObj->methodExists($handlerName)) { $this->componentContext = $componentObj; $result = $componentObj->runAjaxHandler($handlerName); - return ($result) ?: true; + return $result ?: true; } } /* @@ -726,12 +726,12 @@ class Controller else { if (method_exists($this->pageObj, $handler)) { $result = $this->pageObj->$handler(); - return ($result) ?: true; + return $result ?: true; } if (!$this->layout->isFallBack() && method_exists($this->layoutObj, $handler)) { $result = $this->layoutObj->$handler(); - return ($result) ?: true; + return $result ?: true; } /* @@ -740,7 +740,7 @@ class Controller if (($componentObj = $this->findComponentByHandler($handler)) !== null) { $this->componentContext = $componentObj; $result = $componentObj->runAjaxHandler($handler); - return ($result) ?: true; + return $result ?: true; } } diff --git a/modules/system/classes/VersionManager.php b/modules/system/classes/VersionManager.php index dcedfdc07..ace928272 100644 --- a/modules/system/classes/VersionManager.php +++ b/modules/system/classes/VersionManager.php @@ -79,7 +79,7 @@ class VersionManager */ public function updatePlugin($plugin, $stopOnVersion = null) { - $code = (is_string($plugin)) ? $plugin : $this->pluginManager->getIdentifier($plugin); + $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin); if (!$this->hasVersionFile($code)) { return false; @@ -111,7 +111,7 @@ class VersionManager */ public function listNewVersions($plugin) { - $code = (is_string($plugin)) ? $plugin : $this->pluginManager->getIdentifier($plugin); + $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin); if (!$this->hasVersionFile($code)) { return []; @@ -165,7 +165,7 @@ class VersionManager */ public function removePlugin($plugin, $stopOnVersion = null) { - $code = (is_string($plugin)) ? $plugin : $this->pluginManager->getIdentifier($plugin); + $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin); if (!$this->hasVersionFile($code)) { return false; @@ -327,7 +327,7 @@ class VersionManager ; } - return (isset($this->databaseVersions[$code])) + return isset($this->databaseVersions[$code]) ? $this->databaseVersions[$code] : self::NO_VERSION_VALUE; } diff --git a/modules/system/models/File.php b/modules/system/models/File.php index 40f6a46af..b61f7d985 100644 --- a/modules/system/models/File.php +++ b/modules/system/models/File.php @@ -75,6 +75,6 @@ class File extends FileBase protected function copyLocalToStorage($localPath, $storagePath) { $disk = Storage::disk(Config::get('cms.storage.uploads.disk')); - return $disk->put($storagePath, FileHelper::get($localPath), ($this->isPublic()) ? 'public' : null); + return $disk->put($storagePath, FileHelper::get($localPath), $this->isPublic() ? 'public' : null); } } diff --git a/modules/system/traits/ViewMaker.php b/modules/system/traits/ViewMaker.php index ac8d1d248..2041f3f42 100644 --- a/modules/system/traits/ViewMaker.php +++ b/modules/system/traits/ViewMaker.php @@ -300,6 +300,6 @@ trait ViewMaker $classFolder = strtolower(class_basename($class)); $classFile = realpath(dirname(File::fromClass($class))); $guessedPath = $classFile ? $classFile . '/' . $classFolder . $suffix : null; - return ($isPublic) ? File::localToPublic($guessedPath) : $guessedPath; + return $isPublic ? File::localToPublic($guessedPath) : $guessedPath; } }