Skip to content

Commit 6b3f9de

Browse files
authored
Merge pull request #41 from baldwin-agency/php82-support-attempt
PHP 8.2 support
2 parents 68e62d4 + f6b111a commit 6b3f9de

File tree

17 files changed

+5834
-2799
lines changed

17 files changed

+5834
-2799
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.php-cs-fixer.cache
22
/auth.json
33
/Test/.phpunit.result.cache
4+
/vendor-bin/*/vendor
45
/vendor/

.php-auto-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
php82

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$finder = PhpCsFixer\Finder::create()
44
->in(__DIR__)
55
->exclude('vendor')
6+
->exclude('vendor-bin')
67
;
78

89
$config = new PhpCsFixer\Config();

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ check: checkstyle checkquality test
1010

1111
.PHONY: checkstyle
1212
checkstyle:
13-
vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
14-
vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility --ignore=./vendor/ .
15-
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./Test/ .
16-
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
13+
PHP_CS_FIXER_IGNORE_ENV=1 vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
14+
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/ .
15+
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./vendor-bin/,./Test/ .
16+
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
1717
vendor/bin/composer normalize --dry-run
1818

1919
.PHONY: checkquality
2020
checkquality:
21-
vendor/bin/phpstan analyse
21+
vendor-bin/phpstan/vendor/bin/phpstan analyse
2222

2323
xmllint --noout --schema vendor/magento/module-store/etc/config.xsd etc/config.xml
2424
xmllint --noout --schema vendor/magento/module-backend/etc/menu.xsd etc/adminhtml/menu.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ It should be up to the store owner to figure out how he/she wants to fix these p
2929
This module should be compatible with Magento 2.1.x, 2.2.x, 2.3.x and 2.4.x versions.
3030
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.
3131

32-
The module should be compatible with PHP 7.0, 7.1, 7.2, 7.3 and 7.4
32+
The module should be compatible with PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.1 and 8.2
3333

3434
## Installation
3535

Test/Checker/Catalog/Product/UrlKey/DuplicateUrlKeyTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;
1414
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;
1515
use Magento\Framework\DataObject;
16-
use PHPUnit\Framework\MockObject\MockObject;
1716
use PHPUnit\Framework\TestCase;
1817

1918
class DuplicateUrlKeyTest extends TestCase
@@ -48,7 +47,6 @@ function ($productData) use ($storeId) {
4847

4948
$collectionsPerStoreId = array_map(
5049
function ($productsData) {
51-
/** @var MockObject $productCollectionMock */
5250
$productCollectionMock = $this->getMockBuilder(ProductCollection::class)
5351
->disableOriginalConstructor()
5452
->getMock();
@@ -74,7 +72,6 @@ function ($productsData) {
7472
$dataPerStoreId
7573
);
7674

77-
/** @var StoresUtil&MockObject */
7875
$storesUtilMock = $this
7976
->getMockBuilder(StoresUtil::class)
8077
->disableOriginalConstructor()
@@ -83,13 +80,11 @@ function ($productsData) {
8380
->method('getAllStoreIds')
8481
->willReturn($storeIds);
8582

86-
/** @var Progress&MockObject */
8783
$progressMock = $this
8884
->getMockBuilder(Progress::class)
8985
->disableOriginalConstructor()
9086
->getMock();
9187

92-
/** @var ProductCollectionFactory&MockObject */
9388
$productCollectionFactoryMock = $this
9489
->getMockBuilder(ProductCollectionFactory::class)
9590
->disableOriginalConstructor()
@@ -110,7 +105,6 @@ function ($productsData) {
110105
->method('containsValue')
111106
->willReturn(true);
112107

113-
/** @var AttributeScopeOverriddenValueFactory&MockObject */
114108
$attributeScopeOverriddenValueFactoryMock = $this
115109
->getMockBuilder(AttributeScopeOverriddenValueFactory::class)
116110
->disableOriginalConstructor()
@@ -120,7 +114,6 @@ function ($productsData) {
120114
->method('create')
121115
->willReturn($attributeScopeOverriddenValueMock);
122116

123-
/** @var ConfigUtil&MockObject */
124117
$configUtilMock = $this
125118
->getMockBuilder(ConfigUtil::class)
126119
->disableOriginalConstructor()

Test/Storage/CacheStorageTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Baldwin\UrlDataIntegrityChecker\Storage\CacheStorage;
88
use Magento\Framework\App\Cache as AppCache;
9-
use PHPUnit\Framework\MockObject\MockObject;
109
use PHPUnit\Framework\TestCase;
1110

1211
class CacheStorageTest extends TestCase
@@ -19,7 +18,6 @@ public function testUpdatingNonExisting()
1918
'key2' => 'value2',
2019
];
2120

22-
/** @var AppCache&MockObject */
2321
$cacheMock = $this
2422
->getMockBuilder(AppCache::class)
2523
->disableOriginalConstructor()
@@ -57,7 +55,6 @@ public function testUpdatingExisting()
5755
'key3' => 'value3',
5856
];
5957

60-
/** @var AppCache&MockObject */
6158
$cacheMock = $this
6259
->getMockBuilder(AppCache::class)
6360
->disableOriginalConstructor()
@@ -95,7 +92,6 @@ public function testClear()
9592

9693
$expectedData = [];
9794

98-
/** @var AppCache&MockObject */
9995
$cacheMock = $this
10096
->getMockBuilder(AppCache::class)
10197
->disableOriginalConstructor()

Ui/Component/Listing/Column/EditAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function prepareDataSource(array $dataSource)
4848

4949
$item[$this->getData('name')] = [
5050
'edit' => [
51-
'href' => $this->urlBuilder->getUrl(
51+
'href' => $this->urlBuilder->getUrl(
5252
$editUrlPath,
5353
[
5454
'id' => $entityId,

composer.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.1.0",
14+
"php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.1.0 || ~8.2.0",
1515
"magento/framework": "^100.1 || ^101.0 || ^102.0 || ^103.0",
1616
"magento/module-backend": "^100.1 || ^101.0 || ^102.0",
1717
"magento/module-catalog": "^101.0 || ^102.0 || ^103.0 || ^104.0",
@@ -23,15 +23,9 @@
2323
"symfony/console": "^2.5 || ^3.0 || ^4.0 || ^5.0"
2424
},
2525
"require-dev": {
26-
"bitexpert/phpstan-magento": "^0.23.0",
26+
"bamarni/composer-bin-plugin": "^1.7",
2727
"ergebnis/composer-normalize": "^2.17",
28-
"friendsofphp/php-cs-fixer": "^3.0",
29-
"magento/magento-coding-standard": ">=6",
3028
"mikey179/vfsstream": "^1.6",
31-
"phpcompatibility/php-compatibility": "^9.2",
32-
"phpstan/extension-installer": "^1.0",
33-
"phpstan/phpstan": "^1.1",
34-
"phpstan/phpstan-deprecation-rules": "^1.0",
3529
"phpunit/phpunit": "^9.0"
3630
},
3731
"repositories": [
@@ -50,18 +44,16 @@
5044
},
5145
"config": {
5246
"allow-plugins": {
47+
"bamarni/composer-bin-plugin": true,
5348
"ergebnis/composer-normalize": true,
54-
"magento/composer-dependency-version-audit-plugin": true,
55-
"phpstan/extension-installer": true
49+
"magento/composer-dependency-version-audit-plugin": true
5650
},
5751
"sort-packages": true
5852
},
59-
"scripts": {
60-
"post-install-cmd": [
61-
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard,vendor/phpcompatibility/php-compatibility)"
62-
],
63-
"post-update-cmd": [
64-
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard,vendor/phpcompatibility/php-compatibility)"
65-
]
53+
"extra": {
54+
"bamarni-bin": {
55+
"bin-links": false,
56+
"forward-command": true
57+
}
6658
}
6759
}

0 commit comments

Comments
 (0)