Modify conditions to use elvis operators

This commit is contained in:
Nathan van der Werf 2018-08-15 18:53:11 +02:00
parent bc17975634
commit 77b6f07291
4 changed files with 7 additions and 7 deletions

View File

@ -151,11 +151,11 @@ class Filter extends WidgetBase
$min = $scope->value[0];
$max = $scope->value[1];
$params['minStr'] = $min ? $min : '';
$params['min'] = $min ? $min : null;
$params['minStr'] = $min ?: '';
$params['min'] = $min ?: null;
$params['maxStr'] = $max ? $max : '∞';
$params['max'] = $max ? $max : null;
$params['maxStr'] = $max ?: '∞';
$params['max'] = $max ?: null;
}
break;

View File

@ -535,7 +535,7 @@ class MediaManager extends WidgetBase
$urlAndSize = $this->getCropEditImageUrlAndSize($path, $cropSessionKey);
$width = $urlAndSize['dimensions'][0];
$height = $urlAndSize['dimensions'][1] ? $urlAndSize['dimensions'][1] : 1;
$height = $urlAndSize['dimensions'][1] ?: 1;
$this->vars['currentSelectionMode'] = $selectionParams['mode'];
$this->vars['currentSelectionWidth'] = $selectionParams['width'];

View File

@ -279,7 +279,7 @@ class CmsCompoundObject extends CmsObject
else {
$cached = Cache::get($key, false);
$unserialized = $cached ? @unserialize(@base64_decode($cached)) : false;
$objectComponentMap = $unserialized ? $unserialized : [];
$objectComponentMap = $unserialized ?: [];
if ($objectComponentMap) {
self::$objectComponentPropertyMap = $objectComponentMap;
}

View File

@ -118,7 +118,7 @@ class Controller
*/
public function __construct($theme = null)
{
$this->theme = $theme ? $theme : Theme::getActiveTheme();
$this->theme = $theme ?: Theme::getActiveTheme();
if (!$this->theme) {
throw new CmsException(Lang::get('cms::lang.theme.active.not_found'));
}