Skip to content

Commit 52580cc

Browse files
committed
Fix static analysis
1 parent 03654f8 commit 52580cc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/code/Magento/Cron/Console/Command/CronCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
105105
$output->writeln('<info>' . 'Cron is disabled. Jobs were not run.' . '</info>');
106106
return;
107107
}
108+
// phpcs:ignore Magento2.Security.Superglobal.SuperglobalUsageWarning
108109
$omParams = $_SERVER;
109110
$omParams[StoreManager::PARAM_RUN_CODE] = 'admin';
110111
$omParams[Store::CUSTOM_ENTRY_POINT_PARAM] = true;
@@ -128,5 +129,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
128129
$cronObserver = $objectManager->create(\Magento\Framework\App\Cron::class, ['parameters' => $params]);
129130
$cronObserver->launch();
130131
$output->writeln('<info>' . 'Ran jobs by schedule.' . '</info>');
132+
return Cli::RETURN_SUCCESS;
131133
}
132134
}

dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testGroupFilters(array $expectedGroupsToRun, $group = null, $exc
7272
}
7373

7474
// No expected lock data, means we should never call it
75-
if (empty($expectedLockData)){
75+
if (empty($expectedLockData)) {
7676
$lockManager->expects($this->never())
7777
->method('lock');
7878
}
@@ -132,7 +132,9 @@ public function groupFiltersDataProvider(): array
132132
['default'], // --exclude-group default
133133
],
134134
'--exclude-group=index, all other groups should run' => [
135-
array_filter($listOfGroups, function($g) { return $g !== 'index'; }), // groups to run, all but index
135+
array_filter($listOfGroups, function ($g) {
136+
return $g !== 'index';
137+
}), // groups to run, all but index
136138
null, //
137139
['index'] // --exclude-group index
138140
],
@@ -142,9 +144,13 @@ public function groupFiltersDataProvider(): array
142144
$listOfGroups // groups to exclude, all of them
143145
],
144146
'exclude all groups but consumers, consumers runs' => [
145-
array_filter($listOfGroups, function($g) { return $g === 'consumers'; }),
147+
array_filter($listOfGroups, function ($g) {
148+
return $g === 'consumers';
149+
}),
146150
null,
147-
array_filter($listOfGroups, function($g) { return $g !== 'consumers'; })
151+
array_filter($listOfGroups, function ($g) {
152+
return $g !== 'consumers';
153+
})
148154
],
149155
];
150156
}

0 commit comments

Comments
 (0)