mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Modify conditions to use elvis operators
This commit is contained in:
parent
bc17975634
commit
77b6f07291
@ -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;
|
||||
|
@ -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'];
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user