Skip to content

Commit

Permalink
Improve condition checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Krzyzanowski committed Aug 30, 2019
1 parent bedcc5a commit 0332f7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Console/Command/CategoriesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

foreach ($this->baseParentCategories as $category) {
foreach (!empty($this->baseParentCategories) ? $this->baseParentCategories : [] as $category) {
$this->addOrUpdateCategory($category, true);
}

foreach ($this->childCategories as $category) {
foreach (!empty($this->childCategories) ? $this->childCategories : [] as $category) {
$this->addOrUpdateCategory($category);
}

if (count($this->errors) > 0) {
if (!empty($this->errors)) {
$output->writeln('There was ' . count($this->errors) . ' errors:');
foreach ($this->errors as $error) {
$output->writeln($error);
Expand Down Expand Up @@ -314,4 +314,4 @@ protected function mapHeaders($row)
}
}
}
}
}

0 comments on commit 0332f7f

Please sign in to comment.