Skip to content

Commit cb0b702

Browse files
committed
Merge branch 'drop-php70-support' into v1-develop
2 parents 8a176e2 + 912a3e5 commit cb0b702

40 files changed

+72
-75
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
'declare_strict_types' => true,
1515
'no_alias_functions' => true,
1616
'no_useless_sprintf' => true,
17-
'nullable_type_declaration_for_default_null_value' => false, // should be 'true' when we drop support for PHP 7.0 which didn't support nullable types yet
17+
'nullable_type_declaration_for_default_null_value' => true,
1818
'ordered_imports' => ['sort_algorithm' => 'alpha'],
1919
'phpdoc_align' => ['align' => 'vertical'],
2020
'phpdoc_separation' => ['skip_unlisted_annotations' => true],
2121
'self_accessor' => true,
22-
'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now
2322
])
2423
->setFinder($finder)
2524
;

Checker/Catalog/Category/UrlKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
class UrlKey
1111
{
12-
const URL_KEY_ATTRIBUTE = 'url_key';
13-
const STORAGE_IDENTIFIER = 'category-url-key';
12+
public const URL_KEY_ATTRIBUTE = 'url_key';
13+
public const STORAGE_IDENTIFIER = 'category-url-key';
1414

1515
private $duplicateUrlKeyChecker;
1616
private $emptyUrlKeyChecker;

Checker/Catalog/Category/UrlKey/DuplicateUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class DuplicateUrlKey
1212
{
13-
const DUPLICATED_PROBLEM_DESCRIPTION =
13+
public const DUPLICATED_PROBLEM_DESCRIPTION =
1414
'%s categories were found which have a duplicated url_key value: "%s" within the same parent.'
1515
. ' Please fix because this will cause problems.';
1616

Checker/Catalog/Category/UrlKey/EmptyUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class EmptyUrlKey
1717
{
18-
const EMPTY_PROBLEM_DESCRIPTION = 'Category has an empty url_key value. This needs to be fixed.';
18+
public const EMPTY_PROBLEM_DESCRIPTION = 'Category has an empty url_key value. This needs to be fixed.';
1919

2020
private $storesUtil;
2121
private $categoryCollectionFactory;

Checker/Catalog/Category/UrlPath.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
class UrlPath
1717
{
18-
const URL_PATH_ATTRIBUTE = 'url_path';
19-
const URL_PATH_SEPARATOR = '/';
20-
const PROBLEM_DESCRIPTION =
18+
public const URL_PATH_ATTRIBUTE = 'url_path';
19+
public const URL_PATH_SEPARATOR = '/';
20+
public const PROBLEM_DESCRIPTION =
2121
'Category has an incorrect url_path value "%s". It should be "%s".'
2222
. ' Unfortunately this is not easily fixable using the backend of Magento.';
23-
const STORAGE_IDENTIFIER = 'category-url-path';
23+
public const STORAGE_IDENTIFIER = 'category-url-path';
2424

2525
private $storesUtil;
2626
private $categoryCollectionFactory;
@@ -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.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
class UrlKey
1111
{
12-
const URL_KEY_ATTRIBUTE = 'url_key';
13-
const STORAGE_IDENTIFIER = 'product-url-key';
12+
public const URL_KEY_ATTRIBUTE = 'url_key';
13+
public const STORAGE_IDENTIFIER = 'product-url-key';
1414

1515
private $duplicateUrlKeyChecker;
1616
private $emptyUrlKeyChecker;

Checker/Catalog/Product/UrlKey/DuplicateUrlKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class DuplicateUrlKey
2020
{
21-
const DUPLICATED_PROBLEM_DESCRIPTION =
21+
public const DUPLICATED_PROBLEM_DESCRIPTION =
2222
'Product has a duplicated url_key value (%s). It\'s the same as another product (ID: %s, Store: %s).'
2323
. ' Please fix because this will cause problems.';
2424

@@ -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()));

Checker/Catalog/Product/UrlKey/EmptyUrlKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class EmptyUrlKey
2020
{
21-
const EMPTY_PROBLEM_DESCRIPTION = 'Product has an empty url_key value. This needs to be fixed.';
21+
public const EMPTY_PROBLEM_DESCRIPTION = 'Product has an empty url_key value. This needs to be fixed.';
2222

2323
private $storesUtil;
2424
private $progress;

Checker/Catalog/Product/UrlPath.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
class UrlPath
1818
{
19-
const URL_PATH_ATTRIBUTE = 'url_path';
20-
const PROBLEM_DESCRIPTION =
19+
public const URL_PATH_ATTRIBUTE = 'url_path';
20+
public const PROBLEM_DESCRIPTION =
2121
'Product has a non-null url_path attribute, this is known to cause problems with url rewrites in Magento.'
2222
. ' It\'s advised to remove this value from the database.';
23-
const STORAGE_IDENTIFIER = 'product-url-path';
23+
public const STORAGE_IDENTIFIER = 'product-url-path';
2424

2525
private $storesUtil;
2626
private $productCollectionFactory;

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.');

0 commit comments

Comments
 (0)