Skip to content

Commit

Permalink
MAGETWO-86742: Optimization: magento/module-eav is_null change to str…
Browse files Browse the repository at this point in the history
…ict comparison … #13169
  • Loading branch information
ishakhsuvarov authored Jan 16, 2018
2 parents 9ceb40a + f6d6741 commit 97b5171
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Eav/Model/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function setWebsite($website)
*/
public function getWebsite()
{
if (is_null($this->_website)) {
if ($this->_website === null) {
$this->_website = $this->_storeManager->getWebsite();
}

Expand All @@ -88,7 +88,7 @@ public function afterSave()
public function getUsedInForms()
{
$forms = $this->getData('used_in_forms');
if (is_null($forms)) {
if ($forms === null) {
$forms = $this->_getResource()->getUsedInForms($this);
$this->setData('used_in_forms', $forms);
}
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function setExtractedData(array $data)
*/
public function getExtractedData($index = null)
{
if (!is_null($index)) {
if ($index !== null) {
if (isset($this->_extractedData[$index])) {
return $this->_extractedData[$index];
}
Expand Down Expand Up @@ -262,9 +262,9 @@ protected function _getFormFilter()
*/
protected function _dateFilterFormat($format = null)
{
if (is_null($format)) {
if ($format === null) {
// get format
if (is_null($this->_dateFilterFormat)) {
if ($this->_dateFilterFormat === null) {
$this->_dateFilterFormat = \IntlDateFormatter::SHORT;
}
return $this->_localeDate->getDateFormat($this->_dateFilterFormat);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Eav/Model/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ protected function _collectSaveData($newObject)
$origData = $this->_getOrigObject($newObject)->getOrigData();
}

if (is_null($origData)) {
if ($origData === null) {
$origData = [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function beforeSave($object)
throw new \Magento\Framework\Exception\LocalizedException(__('Invalid date'));
}

if (is_null($value)) {
if ($value === null) {
$value = $object->getData($attributeName);
}

Expand Down

0 comments on commit 97b5171

Please sign in to comment.