Skip to content

Commit c62ded4

Browse files
committed
fix: simplify literal boolean checks
1 parent 1a805d0 commit c62ded4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Error extends \Magento\AdminNotification\Model\System\Message\Media\Abstra
2727
protected function _shouldBeDisplayed()
2828
{
2929
$data = $this->_syncFlag->getFlagData();
30-
return isset($data['has_errors']) && true == $data['has_errors'];
30+
return !empty($data['has_errors']);
3131
}
3232

3333
/**

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Success.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ protected function _shouldBeDisplayed()
2727
{
2828
$state = $this->_syncFlag->getState();
2929
$data = $this->_syncFlag->getFlagData();
30-
$hasErrors = isset($data['has_errors']) && true == $data['has_errors'] ? true : false;
31-
return false == $hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
30+
$hasErrors = !empty($data['has_errors']);
31+
return !$hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
3232
}
3333

3434
/**

0 commit comments

Comments
 (0)