Skip to content

Commit 912a3e5

Browse files
committed
Added void return types where possible, now that the minimum supported PHP version is 7.1
1 parent bb6fc71 commit 912a3e5

15 files changed

+26
-28
lines changed

Checker/Catalog/Category/UrlPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function getCalculatedUrlPathForCategory(Category $category, int $storeId
164164
));
165165
}
166166

167-
private function fetchAllCategoriesWithUrlPathCalculatedByUrlKey()
167+
private function fetchAllCategoriesWithUrlPathCalculatedByUrlKey(): void
168168
{
169169
$this->calculatedUrlPathPerCategoryAndStoreId = [];
170170

Checker/Catalog/Product/UrlKey/DuplicateUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private function checkForDuplicatedUrlKeyAttributeValues(): array
118118
/**
119119
* @param ProductCollection<ProductModel> $collection
120120
*/
121-
private function storeProductUrlKeyData(int $storeId, ProductCollection $collection)
121+
private function storeProductUrlKeyData(int $storeId, ProductCollection $collection): void
122122
{
123123
foreach ($collection as $product) {
124124
assert(is_numeric($product->getEntityId()));

Console/Command/CheckCategoryUrlKeys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
parent::__construct();
3838
}
3939

40-
protected function configure()
40+
protected function configure(): void
4141
{
4242
$this->setName('catalog:category:integrity:urlkey');
4343
$this->setDescription('Checks data integrity of the values of the url_key category attribute.');

Console/Command/CheckCategoryUrlPaths.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
parent::__construct();
3838
}
3939

40-
protected function configure()
40+
protected function configure(): void
4141
{
4242
$this->setName('catalog:category:integrity:urlpath');
4343
$this->setDescription('Checks data integrity of the values of the url_path category attribute.');

Console/Command/CheckProductUrlKeys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
parent::__construct();
4242
}
4343

44-
protected function configure()
44+
protected function configure(): void
4545
{
4646
$this->setName('catalog:product:integrity:urlkey');
4747
$this->setDescription('Checks data integrity of the values of the url_key product attribute.');

Console/Command/CheckProductUrlPaths.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
parent::__construct();
3838
}
3939

40-
protected function configure()
40+
protected function configure(): void
4141
{
4242
$this->setName('catalog:product:integrity:urlpath');
4343
$this->setDescription('Checks data integrity of the values of the url_path product attribute.');

Console/Progress.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function __construct()
2424
$this->format = '';
2525
}
2626

27-
public function setOutput(OutputInterface $output)
27+
public function setOutput(OutputInterface $output): void
2828
{
2929
$this->output = $output;
3030
}
3131

32-
public function initProgressBar(int $redrawFequency, string $format, string $message)
32+
public function initProgressBar(int $redrawFequency, string $format, string $message): void
3333
{
3434
if ($this->canOutput()) {
3535
$this->progressBar = new ProgressBar($this->output);
@@ -42,35 +42,35 @@ public function initProgressBar(int $redrawFequency, string $format, string $mes
4242
}
4343
}
4444

45-
public function setGuestimatedSize(int $nrOfIndexes, int $sizePerIndex)
45+
public function setGuestimatedSize(int $nrOfIndexes, int $sizePerIndex): void
4646
{
4747
for ($i = 0; $i < $nrOfIndexes; ++$i) {
4848
$this->sizeByIndex[$i] = $sizePerIndex;
4949
}
5050
$this->updateMaxSteps();
5151
}
5252

53-
public function updateExpectedSize(int $index, int $size)
53+
public function updateExpectedSize(int $index, int $size): void
5454
{
5555
$this->sizeByIndex[$index] = $size;
5656
$this->updateMaxSteps();
5757
}
5858

59-
public function advance()
59+
public function advance(): void
6060
{
6161
if ($this->canOutput()) {
6262
$this->progressBar->advance();
6363
}
6464
}
6565

66-
public function setMessage(string $message)
66+
public function setMessage(string $message): void
6767
{
6868
if ($this->canOutput()) {
6969
$this->progressBar->setMessage($message);
7070
}
7171
}
7272

73-
public function finish()
73+
public function finish(): void
7474
{
7575
if ($this->canOutput()) {
7676
$this->progressBar->finish();
@@ -82,7 +82,7 @@ private function canOutput(): bool
8282
return $this->output !== null;
8383
}
8484

85-
private function updateMaxSteps()
85+
private function updateMaxSteps(): void
8686
{
8787
if ($this->canOutput()) {
8888
$newMaxStepsValue = (int) array_sum($this->sizeByIndex);

Cron/CheckCategoryUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
$this->urlKeyUpdater = $urlKeyUpdater;
2020
}
2121

22-
public function execute()
22+
public function execute(): void
2323
{
2424
$this->urlKeyUpdater->refresh(MetaStorage::INITIATOR_CRON);
2525
}

Cron/CheckCategoryUrlPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
$this->urlPathUpdater = $urlPathUpdater;
2020
}
2121

22-
public function execute()
22+
public function execute(): void
2323
{
2424
$this->urlPathUpdater->refresh(MetaStorage::INITIATOR_CRON);
2525
}

Cron/CheckProductUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
$this->urlKeyUpdater = $urlKeyUpdater;
2020
}
2121

22-
public function execute()
22+
public function execute(): void
2323
{
2424
$this->urlKeyUpdater->refresh(MetaStorage::INITIATOR_CRON);
2525
}

0 commit comments

Comments
 (0)