Skip to content

Commit d01c482

Browse files
ENGCOM-3658: fix: simplify literal boolean checks #19672
- Merge Pull Request #19672 from DanielRuf/magento2:fix/adminnotification-simplify-literal-boolean-checks - Merged commits: 1. c62ded4
2 parents 6478d2b + 8fa5fa0 commit d01c482

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
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
/**

app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getColumns(SelectBuilder $selectBuilder, $entityConfig)
7676
$columnName = $this->nameResolver->getName($attributeData);
7777
if (isset($attributeData['function'])) {
7878
$prefix = '';
79-
if (isset($attributeData['distinct']) && $attributeData['distinct'] == true) {
79+
if (!empty($attributeData['distinct'])) {
8080
$prefix = ' DISTINCT ';
8181
}
8282
$expression = new ColumnValueExpression(

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
191191
->with(
192192
$archiveSource,
193193
$archiveAbsolutePath,
194-
$isArchiveSourceDirectory ? true : false
194+
$isArchiveSourceDirectory
195195
);
196196

197197
$fileContent = 'Some text';
@@ -222,7 +222,7 @@ public function prepareExportDataDataProvider()
222222
{
223223
return [
224224
'Data source for archive is directory' => [true],
225-
'Data source for archive doesn\'t directory' => [false],
225+
'Data source for archive isn\'t directory' => [false],
226226
];
227227
}
228228

0 commit comments

Comments
 (0)