Skip to content

Commit

Permalink
Merge branch 'v1-develop' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
hostep committed Mar 22, 2024
2 parents 0cc21c6 + 23d4c14 commit 6ab3448
Show file tree
Hide file tree
Showing 17 changed files with 1,397 additions and 1,535 deletions.
32 changes: 11 additions & 21 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,17 @@
$config = new PhpCsFixer\Config();
return $config
->setRules([
'@Symfony' => true,
'@PSR12' => true,
'binary_operator_spaces' => ['default' => null, 'operators' => ['=>' => 'align']],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'no_alias_functions' => true,
'no_useless_sprintf' => true,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha'
],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_summary' => false,
'self_accessor' => true,
'single_line_throw' => false,
'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now
'yoda_style' => false,
'@PER-CS' => true,
'binary_operator_spaces' => ['default' => 'at_least_single_space', 'operators' => ['=>' => 'align']],
'declare_strict_types' => true,
'no_alias_functions' => true,
'no_useless_sprintf' => true,
'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
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_separation' => ['skip_unlisted_annotations' => true],
'self_accessor' => true,
'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now
])
->setFinder($finder)
;
2 changes: 1 addition & 1 deletion Checker/Catalog/Category/UrlKey/DuplicateUrlKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class DuplicateUrlKey
{
const DUPLICATED_PROBLEM_DESCRIPTION =
'%s categories were found which have a duplicated url_key value: "%s" within the same parent.'
'%s categories were found which have a duplicated url_key value: "%s" within the same parent.'
. ' Please fix because this will cause problems.';

private $storesUtil;
Expand Down
2 changes: 1 addition & 1 deletion Checker/Catalog/Category/UrlPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UrlPath
const URL_PATH_ATTRIBUTE = 'url_path';
const URL_PATH_SEPARATOR = '/';
const PROBLEM_DESCRIPTION =
'Category has an incorrect url_path value "%s". It should be "%s".'
'Category has an incorrect url_path value "%s". It should be "%s".'
. ' Unfortunately this is not easily fixable using the backend of Magento.';
const STORAGE_IDENTIFIER = 'category-url-path';

Expand Down
7 changes: 4 additions & 3 deletions Checker/Catalog/Product/UrlKey/DuplicateUrlKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class DuplicateUrlKey
{
const DUPLICATED_PROBLEM_DESCRIPTION =
'Product has a duplicated url_key value (%s). It\'s the same as another product (ID: %s, Store: %s).'
'Product has a duplicated url_key value (%s). It\'s the same as another product (ID: %s, Store: %s).'
. ' Please fix because this will cause problems.';

private $storesUtil;
Expand Down Expand Up @@ -214,9 +214,10 @@ function ($urlKey) use ($urlKeysWhichExistMoreThanOnce) {
$conflictingStoreId
),
];
// if same product id, we don't care,
// since it wouldn't be a conflict if they exist in another storeview
} elseif ($productId !== $conflictingProductId) {
// ^^^ if same product id, we don't care,
// since it wouldn't be a conflict if they exist in another storeview

if (array_key_exists("$conflictingStoreId-$productId", $inheritedProductUrlKeyData)
&& $inheritedProductUrlKeyData["$conflictingStoreId-$productId"] === $urlKey
) {
Expand Down
2 changes: 1 addition & 1 deletion Checker/Catalog/Product/UrlPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UrlPath
{
const URL_PATH_ATTRIBUTE = 'url_path';
const PROBLEM_DESCRIPTION =
'Product has a non-null url_path attribute, this is known to cause problems with url rewrites in Magento.'
'Product has a non-null url_path attribute, this is known to cause problems with url rewrites in Magento.'
. ' It\'s advised to remove this value from the database.';
const STORAGE_IDENTIFIER = 'product-url-path';

Expand Down
4 changes: 1 addition & 3 deletions Exception/AlreadyRefreshingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Magento\Framework\Exception\LocalizedException;

class AlreadyRefreshingException extends LocalizedException
{
}
class AlreadyRefreshingException extends LocalizedException {}
4 changes: 1 addition & 3 deletions Exception/MissingConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Magento\Framework\Exception\LocalizedException;

class MissingConfigurationException extends LocalizedException
{
}
class MissingConfigurationException extends LocalizedException {}
4 changes: 1 addition & 3 deletions Exception/SerializationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Magento\Framework\Exception\LocalizedException;

class SerializationException extends LocalizedException
{
}
class SerializationException extends LocalizedException {}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ check: checkstyle checkquality test
.PHONY: checkstyle
checkstyle:
vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility --ignore=./vendor/,./vendor-bin/ .
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility,PSR2.Classes.ClassDeclaration,Squiz.WhiteSpace.ScopeClosingBrace,Magento2.Legacy.EscapeMethodsOnBlockClass --ignore=./vendor/,./vendor-bin/ .
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./vendor-bin/,./Test/ .
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
vendor/bin/composer normalize --dry-run
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ It should be up to the store owner to figure out how he/she wants to fix these p
This module should be compatible with Magento 2.1.x, 2.2.x, 2.3.x and 2.4.x versions.
Some code in this module is using old ways of doing things. It could have been written in a more modern way (using message queues instead of cronjobs, use newer syntax for UI components, ...). But we wanted this module to be compatible with older versions of Magento, so we've chosen this route for now.

The module should be compatible with PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.1 and 8.2
The module should be compatible with PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.1, 8.2 and 8.3

## Installation

Expand Down
6 changes: 3 additions & 3 deletions Storage/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public function isRefreshing(string $storageIdentifier): bool

$metaData = $this->storage->read($storageIdentifier);

if (!empty($metaData) &&
array_key_exists('status', $metaData) &&
$metaData['status'] === self::STATUS_REFRESHING
if (!empty($metaData)
&& array_key_exists('status', $metaData)
&& $metaData['status'] === self::STATUS_REFRESHING
) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.1.0 || ~8.2.0",
"php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"magento/framework": "^100.1 || ^101.0 || ^102.0 || ^103.0",
"magento/module-backend": "^100.1 || ^101.0 || ^102.0",
"magento/module-catalog": "^101.0 || ^102.0 || ^103.0 || ^104.0",
Expand All @@ -20,7 +20,7 @@
"magento/module-store": "^100.1 || ^101.0",
"magento/module-theme": "^100.1 || ^101.0",
"magento/module-ui": "^100.1 || ^101.0",
"symfony/console": "^2.5 || ^3.0 || ^4.0 || ^5.0"
"symfony/console": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.7",
Expand Down
Loading

0 comments on commit 6ab3448

Please sign in to comment.