-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean code #16841
Clean code #16841
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,7 +321,7 @@ function ($title, $storeName) { | |
*/ | ||
protected function getTypeValue($type) | ||
{ | ||
return isset($this->typeMapping[$type]) ? $this->typeMapping[$type] : self::VALUE_DYNAMIC; | ||
return $this->typeMapping[$type]?? self::VALUE_DYNAMIC; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
/** | ||
|
@@ -332,7 +332,7 @@ protected function getTypeValue($type) | |
*/ | ||
protected function getPriceViewValue($type) | ||
{ | ||
return isset($this->priceViewMapping[$type]) ? $this->priceViewMapping[$type] : self::VALUE_PRICE_RANGE; | ||
return $this->priceViewMapping[$type] ?? self::VALUE_PRICE_RANGE; | ||
} | ||
|
||
/** | ||
|
@@ -343,7 +343,7 @@ protected function getPriceViewValue($type) | |
*/ | ||
protected function getPriceTypeValue($type) | ||
{ | ||
return isset($this->priceTypeMapping[$type]) ? $this->priceTypeMapping[$type] : null; | ||
return $this->priceTypeMapping[$type] ?? null; | ||
} | ||
|
||
/** | ||
|
@@ -354,7 +354,7 @@ protected function getPriceTypeValue($type) | |
*/ | ||
private function getShipmentTypeValue($type) | ||
{ | ||
return isset($this->shipmentTypeMapping[$type]) ? $this->shipmentTypeMapping[$type] : null; | ||
return $this->shipmentTypeMapping[$type] ?? null; | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -859,7 +859,7 @@ public function getFrame() | |
*/ | ||
protected function getAttribute($name) | ||
{ | ||
return isset($this->attributes[$name]) ? $this->attributes[$name] : null; | ||
return $this->attributes[$name]?? : null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ public function addHandler($method, $handler) | |
public function getHandlers($method) | ||
{ | ||
$method = strtolower($method); | ||
return isset($this->_handlers[$method]) ? $this->_handlers[$method] : []; | ||
return $this->_handlers[$method] ?? : []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove |
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,7 +312,7 @@ public function getGroupByType($type = null) | |
self::OPTION_TYPE_TIME => self::OPTION_GROUP_DATE, | ||
]; | ||
|
||
return isset($optionGroupsToTypes[$type]) ? $optionGroupsToTypes[$type] : ''; | ||
return $optionGroupsToTypes[$type] ?? : ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove |
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -931,7 +931,7 @@ private function mapConditionType($conditionType) | |
'eq' => 'in', | ||
'neq' => 'nin' | ||
]; | ||
return isset($conditionsMap[$conditionType]) ? $conditionsMap[$conditionType] : $conditionType; | ||
return $conditionsMap[$conditionType] ?? $conditionType; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove 2nd space after |
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,6 @@ public function prepare() | |
*/ | ||
protected function getFilterType($frontendInput) | ||
{ | ||
return isset($this->filterMap[$frontendInput]) ? $this->filterMap[$frontendInput] : $this->filterMap['default']; | ||
return $this->filterMap[$frontendInput] ?? $this->filterMap['default']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove 2nd space after |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,6 @@ public function getFieldset($name, $root = 'global') | |
if (empty($fieldsets)) { | ||
return null; | ||
} | ||
return isset($fieldsets[$name]) ? $fieldsets[$name] : null; | ||
return $fieldsets[$name] ?? null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove 2nd space after |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,6 +251,6 @@ public function populateWithArray(array $data) | |
*/ | ||
private function getArrayValueByKey($key, array $array) | ||
{ | ||
return isset($array[$key]) ? $array[$key] : []; | ||
return $array[$key] ?? []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove 2nd space after |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add space before
??