Skip to content

Commit dde6fca

Browse files
[TASK] Improvements after code review
1 parent 06bd51b commit dde6fca

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Classes/Command/ImportNewsCommand.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ImportNewsCommand extends Command
2222
protected const OPTION_NAME_LIMIT = 'limit';
2323
protected const OPTION_NAME_LIMIT_SHORTCUT = 'l';
2424
protected const OPTION_LIMIT_DEFAULT = 1;
25+
2526
/**
2627
* @var array
2728
*/
@@ -51,6 +52,10 @@ class ImportNewsCommand extends Command
5152
* @var ImportService
5253
*/
5354
protected ImportService $importService;
55+
56+
/**
57+
* @var SymfonyStyle
58+
*/
5459
protected SymfonyStyle $io;
5560

5661
public function __construct(
@@ -76,7 +81,6 @@ public function __construct(
7681

7782
/**
7883
* @param StorageRepository $storageRepository
79-
* @return void
8084
*/
8185
protected function setEvaluatePermissionsOnFalse(StorageRepository $storageRepository): void
8286
{
@@ -111,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
111115
$this->io->title($this->getDescription());
112116
$limit = $input->getOption(self::OPTION_NAME_LIMIT);
113117
if (!is_numeric($limit)) {
114-
$this->io->warning('Please provide an number for the limit:' . $limit);
118+
$this->io->warning('Please provide a number for the limit:' . $limit);
115119
return Command::INVALID;
116120
}
117121

@@ -133,10 +137,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
133137
if ($this->importService->alreadyImported($importSource->getStoragePid(), $item->getGuid())) {
134138
$this->io->writeln('Already imported: ' . $item->getGuid());
135139
} elseif ($importSource->getFilterWords() && !$this->importService->matchFilter(
136-
$item,
137-
$importSource->getFilterWords(),
138-
$searchFields
139-
)) {
140+
$item,
141+
$importSource->getFilterWords(),
142+
$searchFields
143+
)) {
140144
$this->io->writeln('Skipped: ' . $item->getGuid() . '; Filter mismatch');
141145
} else {
142146
$this->importService->importItem($importSource, $item);

0 commit comments

Comments
 (0)