Skip to content

Commit 4fe2979

Browse files
authored
Merge pull request #1842 from algolia/chore/MAGE-1383-codacy-3.17
MAGE-1383 Codacy quality checks 3.17
2 parents cae210d + 7cf4315 commit 4fe2979

File tree

24 files changed

+51
-46
lines changed

24 files changed

+51
-46
lines changed

.codacy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
exclude_paths:
3+
- ".php-cs-fixer.php"
4+
- "dev/**"
5+
- "Test/**"

Block/Adminhtml/Queue/Status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function isQueueFast()
158158
{
159159
$averageProcessingTime = $this->queue->getAverageProcessingTime();
160160

161-
return !is_null($averageProcessingTime) && $averageProcessingTime < self::QUEUE_FAST_LIMIT;
161+
return $averageProcessingTime !== null && $averageProcessingTime < self::QUEUE_FAST_LIMIT;
162162
}
163163

164164
/** @return int */

Console/Command/Replica/ReplicaDisableVirtualCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function disableVirtualReplicasForAllStores(): void
151151
public function removeLegacyVirtualReplicaConfig(string $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, int $scopeId = 0): void
152152
{
153153
$value = $this->scopeConfig->getValue(ConfigHelper::LEGACY_USE_VIRTUAL_REPLICA_ENABLED, $scope, $scopeId);
154-
if (is_null($value)) {
154+
if ($value === null) {
155155
return;
156156
}
157157
$this->output->writeln("<info>Removing legacy configuration " . ConfigHelper::LEGACY_USE_VIRTUAL_REPLICA_ENABLED . " for $scope scope" . ($scope != ScopeConfigInterface::SCOPE_TYPE_DEFAULT ? " (ID=$scopeId)" : "") . "</info>");

Controller/Adminhtml/IndexingManager/Reindex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected function reindexEntities(array $entities, ?array $storeIds = null, ?ar
149149
$message = $this->storeNameFetcher->getStoreName($storeId) . " ";
150150
$message .= "(" . $this->indexNameFetcher->getIndexName('_' . $entity, $storeId);
151151

152-
if (!is_null($entityIds)) {
152+
if ($entityIds !== null) {
153153
$recordLabel = count($entityIds) > 1 ? "records" : "record";
154154
$message .= " - " . count($entityIds) . " " . $recordLabel;
155155
} else {

Controller/Adminhtml/Landingpage/Duplicate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function execute()
2626
$landingPage = $this->landingPageFactory->create();
2727
$landingPage->getResource()->load($landingPage, $landingPageId);
2828

29-
if (is_null($landingPage)) {
29+
if ($landingPage === null) {
3030
$this->messageManager->addErrorMessage(__('This landing page does not exists.'));
3131

3232
return $resultRedirect->setPath('*/*/');

Controller/Adminhtml/Landingpage/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Edit extends AbstractAction
1010
public function execute()
1111
{
1212
$landingPage = $this->initLandingPage();
13-
if (is_null($landingPage)) {
13+
if ($landingPage === null) {
1414
$this->messageManager->addErrorMessage(__('This landing page does not exists.'));
1515
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
1616
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

Controller/Adminhtml/Query/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Edit extends AbstractAction
1010
public function execute()
1111
{
1212
$query = $this->initQuery();
13-
if (is_null($query)) {
13+
if ($query === null) {
1414
$this->messageManager->addErrorMessage(__('This query does not exists.'));
1515
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
1616
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

Controller/Adminhtml/Query/Save.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function execute()
120120
$query->getResource()->save($query);
121121

122122
if (isset($data['algolia_merchandising_positions']) && $data['algolia_merchandising_positions'] != ''
123-
|| !is_null($data['banner_image'])) {
123+
|| $data['banner_image'] !== null) {
124124
$this->manageQueryRules($query->getId(), $data);
125125
}
126126

@@ -168,7 +168,7 @@ private function manageQueryRules(int $queryId, array $data): void
168168
$bannerContent = $this->prepareBannerContent($data);
169169

170170
foreach ($stores as $storeId) {
171-
if (!$positions && is_null($bannerContent)) {
171+
if (!$positions && $bannerContent === null) {
172172
$this->merchandisingHelper->deleteQueryRule(
173173
$storeId,
174174
$queryId,

Controller/Adminhtml/Queue/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class View extends AbstractAction
1010
public function execute()
1111
{
1212
$job = $this->initJob();
13-
if (is_null($job)) {
13+
if ($job === null) {
1414
$this->messageManager->addErrorMessage(__('This job does not exist.'));
1515
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
1616
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

Controller/Adminhtml/QueueArchive/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class View extends AbstractAction
1212
public function execute()
1313
{
1414
$job = $this->initJob();
15-
if (is_null($job)) {
15+
if ($job === null) {
1616
$this->messageManager->addErrorMessage(__('This job does not exist.'));
1717
/** @var Redirect $resultRedirect */
1818
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

0 commit comments

Comments
 (0)