Skip to content

Commit 48a04b9

Browse files
authored
Merge pull request #102 from synolia/feat/migration-sylius-latest-v1
[1.x] feat(upgrade): bump codebase to match sylius v[1.12|1.13|1.14]
2 parents 1d35dec + 6d131e8 commit 48a04b9

49 files changed

Lines changed: 309 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/analysis.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Analysis
22
'on':
33
push:
44
branches:
5-
- master
5+
- main
66
paths-ignore:
77
- README.md
88
pull_request:
@@ -16,11 +16,10 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php:
19-
- 8.1
2019
- 8.2
20+
- 8.3
2121
symfony:
22-
- '5.4.*'
23-
- '6.2.*'
22+
- '6.4.*'
2423
env:
2524
APP_ENV: test
2625
steps:

.github/workflows/sylius.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Install & Test
22
'on':
33
push:
44
branches:
5-
- master
5+
- main
66
paths-ignore:
77
- README.md
88
pull_request:
@@ -16,23 +16,16 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php:
19-
- 8.1
2019
- 8.2
20+
- 8.3
2121
sylius:
22-
- 1.10.0
2322
- 1.12.0
23+
- 1.13.0
24+
- 1.14.0
2425
symfony:
25-
- 5.4
26-
- 6.2
26+
- 6.4
2727
node:
2828
- 14.x
29-
exclude:
30-
-
31-
sylius: 1.10.0
32-
symfony: 6.2
33-
-
34-
php: '8.0'
35-
symfony: 6.2
3629
env:
3730
APP_ENV: test
3831
package-name: synolia/sylius-scheduler-command-plugin
@@ -122,7 +115,7 @@ jobs:
122115
run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
123116
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
124117
-
125-
uses: actions/upload-artifact@v2.1.4
118+
uses: actions/upload-artifact@v4
126119
if: failure()
127120
with:
128121
name: logs

Makefile

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
SHELL=/bin/bash
33
COMPOSER_ROOT=composer
44
TEST_DIRECTORY=tests/Application
5-
CONSOLE=cd tests/Application && php bin/console -e test
6-
COMPOSER=cd tests/Application && composer
7-
YARN=cd tests/Application && yarn
8-
9-
SYLIUS_VERSION=1.12.0
10-
SYMFONY_VERSION=6.1
11-
PHP_VERSION=8.1
5+
INSTALL_DIRECTORY=install/Application
6+
CONSOLE=cd ${TEST_DIRECTORY} && php bin/console -e test
7+
COMPOSER=cd ${TEST_DIRECTORY} && composer
8+
YARN=cd ${TEST_DIRECTORY} && yarn
9+
10+
SYLIUS_VERSION=1.14.0
11+
SYMFONY_VERSION=6.4
12+
PHP_VERSION=8.2
1213
PLUGIN_NAME=synolia/sylius-scheduler-command-plugin
1314

1415
###
@@ -19,10 +20,10 @@ install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.12.0] [SYMFONY_VER
1920
.PHONY: install
2021

2122
reset: ## Remove dependencies
22-
ifneq ("$(wildcard tests/Application/bin/console)","")
23+
ifneq ("$(wildcard ${TEST_DIRECTORY}/bin/console)","")
2324
${CONSOLE} doctrine:database:drop --force --if-exists || true
2425
endif
25-
rm -rf tests/Application
26+
rm -rf ${TEST_DIRECTORY}
2627
.PHONY: reset
2728

2829
phpunit: phpunit-configure phpunit-run ## Run PHPUnit
@@ -32,7 +33,7 @@ phpunit: phpunit-configure phpunit-run ## Run PHPUnit
3233
### OTHER
3334
### ¯¯¯¯¯¯
3435

35-
sylius: sylius-standard update-dependencies install-plugin install-sylius configure-sylius
36+
sylius: sylius-standard update-dependencies install-plugin install-sylius
3637
.PHONY: sylius
3738

3839
sylius-standard:
@@ -62,7 +63,7 @@ install-plugin:
6263
${COMPOSER} config minimum-stability "dev"
6364
${COMPOSER} config prefer-stable true
6465
${COMPOSER} req ${PLUGIN_NAME}:* --prefer-source --no-scripts
65-
cp -r install/Application tests
66+
cp -r ${INSTALL_DIRECTORY} tests
6667

6768
install-sylius:
6869
${CONSOLE} doctrine:database:create -n
@@ -73,12 +74,6 @@ install-sylius:
7374
${YARN} build
7475
${CONSOLE} cache:clear
7576

76-
configure-sylius:
77-
cd ${TEST_DIRECTORY} && echo ' Synolia\SyliusSchedulerCommandPlugin\Checker\SoftLimitThresholdIsDueChecker:' >> config/services.yaml
78-
cd ${TEST_DIRECTORY} && echo ' tags:' >> config/services.yaml
79-
cd ${TEST_DIRECTORY} && echo ' - { name: !php/const Synolia\SyliusSchedulerCommandPlugin\Checker\IsDueCheckerInterface::TAG_ID }' >> config/services.yaml
80-
cd ${TEST_DIRECTORY} && echo ' public: true' >> config/services.yaml
81-
8277
phpunit-configure:
8378
cp phpunit.xml.dist ${TEST_DIRECTORY}/phpunit.xml
8479

@@ -97,7 +92,7 @@ grumphp: ## Run GrumPHP
9792
vendor/bin/grumphp run
9893

9994
help: SHELL=/bin/bash
100-
help: ## Dislay this help
95+
help: ## Display this help
10196
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
10297
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \
10398
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \

README.md

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

4242
| | Version |
4343
|:-------|:--------|
44-
| PHP | ^8.0 |
45-
| Sylius | ^1.10 |
44+
| PHP | ^8.2 |
45+
| Sylius | ^1.12 |
4646

4747
## Installation
4848

composer.json

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,54 @@
1010
"description": "Scheduler Command Plugin.",
1111
"license": "MIT",
1212
"require": {
13-
"php": "^8.0",
13+
"php": "^8.2",
1414
"ext-json": "*",
1515
"ext-intl": "*",
16-
"dragonmantank/cron-expression": "^3.0",
17-
"sylius/sylius": "^1.10",
16+
"dragonmantank/cron-expression": "^3.4",
17+
"sylius/sylius": "^1.12",
1818
"symfony/framework-bundle": "^5.4|^6.0",
19-
"symfony/lock": "^5.4|^6.0",
19+
"symfony/lock": "^6.4",
2020
"symfony/polyfill-intl-icu": "^1.26",
21-
"symfony/process": "^5.4|^6.0",
22-
"symfony/service-contracts": "^1.1|^2.0|^3.0",
23-
"webmozart/assert": "^1.10"
21+
"symfony/process": "^6.4",
22+
"symfony/service-contracts": "^3.5",
23+
"webmozart/assert": "^1.11"
2424
},
2525
"require-dev": {
26-
"behat/behat": "3.12.0",
27-
"behat/mink-selenium2-driver": "1.6.0",
28-
"dmore/behat-chrome-extension": "1.4.0",
29-
"dmore/chrome-mink-driver": "2.9.0",
30-
"friends-of-behat/mink": "1.10.0",
31-
"friends-of-behat/mink-browserkit-driver": "1.6.1",
32-
"friends-of-behat/mink-debug-extension": "2.1.0",
33-
"friends-of-behat/mink-extension": "2.7.2",
34-
"friends-of-behat/page-object-extension": "0.3.2",
35-
"friends-of-behat/suite-settings-extension": "1.1.0",
36-
"friends-of-behat/symfony-extension": "2.4.0",
37-
"friends-of-behat/variadic-extension": "1.5.0",
38-
"friendsoftwig/twigcs": "6.0.0",
39-
"j13k/yaml-lint": "1.1.4",
40-
"php-parallel-lint/php-parallel-lint": "1.3.2",
41-
"phpmd/phpmd": "2.13.0",
42-
"phpro/grumphp": "1.15.0",
43-
"phpspec/phpspec": "7.3.0",
44-
"phpstan/extension-installer": "1.2.0",
45-
"phpstan/phpstan": "1.9.5",
46-
"phpstan/phpstan-doctrine": "1.3.28",
47-
"phpstan/phpstan-strict-rules": "1.4.4",
48-
"phpstan/phpstan-webmozart-assert": "1.2.2",
49-
"phpunit/phpunit": "9.5.27",
50-
"rector/rector": "^0.15.2",
51-
"sebastian/phpcpd": "6.0.3",
52-
"seld/jsonlint": "1.9.0",
53-
"slevomat/coding-standard": "8.7.1",
54-
"sylius-labs/coding-standard": "4.3.0",
55-
"symfony/browser-kit": "6.0.11",
56-
"symfony/debug-bundle": "6.0.11",
57-
"symfony/dotenv": "6.0.5",
58-
"symfony/intl": "6.0.15",
59-
"symfony/web-profiler-bundle": "6.0.17",
60-
"symplify/easy-coding-standard": "11.1.32.72"
26+
"behat/behat": "^3.12",
27+
"behat/mink-selenium2-driver": "^1.6",
28+
"dmore/behat-chrome-extension": "^1.4",
29+
"dmore/chrome-mink-driver": "^2.9",
30+
"friends-of-behat/mink": "^1.10",
31+
"friends-of-behat/mink-browserkit-driver": "^1.6",
32+
"friends-of-behat/mink-debug-extension": "^2.1",
33+
"friends-of-behat/mink-extension": "^2.7",
34+
"friends-of-behat/page-object-extension": "^0.3",
35+
"friends-of-behat/suite-settings-extension": "^1.1",
36+
"friends-of-behat/symfony-extension": "^2.4",
37+
"friends-of-behat/variadic-extension": "^1.5",
38+
"friendsoftwig/twigcs": "6.4.0",
39+
"j13k/yaml-lint": "^1.1",
40+
"php-parallel-lint/php-parallel-lint": "^1.4",
41+
"phpmd/phpmd": "^2.15.0",
42+
"phpro/grumphp": "^2.9",
43+
"phpspec/phpspec": "^7.3",
44+
"phpstan/extension-installer": "^1.3",
45+
"phpstan/phpstan": "^2.0",
46+
"phpstan/phpstan-doctrine": "^2.0",
47+
"phpstan/phpstan-strict-rules": "^2.0",
48+
"phpstan/phpstan-webmozart-assert": "^2.0",
49+
"phpunit/phpunit": "^9.5",
50+
"rector/rector": "^2.0",
51+
"seld/jsonlint": "^1.11",
52+
"slevomat/coding-standard": "^8.7",
53+
"squizlabs/php_codesniffer": "^3.11",
54+
"sylius-labs/coding-standard": "^4.3",
55+
"symfony/browser-kit": "^6.4",
56+
"symfony/debug-bundle": "^6.4",
57+
"symfony/dotenv": "^6.4",
58+
"symfony/intl": "^6.4",
59+
"symfony/web-profiler-bundle": "^6.4",
60+
"symplify/easy-coding-standard": "^12.5"
6161
},
6262
"suggest": {
6363
"lorisleiva/cron-translator": "Allow showing humanized and translated cron expression."

grumphp.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,18 @@ grumphp:
55
tasks:
66
composer:
77
no_check_all: true
8-
git_blacklist:
9-
keywords:
10-
- 'var_dump'
11-
- 'dump\('
12-
- 'print_r'
13-
- 'die\('
14-
- 'console\.'
15-
triggered_by: [php, twig, js]
168
jsonlint:
179
detect_key_conflicts: true
18-
phpcpd:
19-
directory:
20-
- src
2110
phplint:
22-
exclude: ['vendor']
11+
exclude: ['vendor', 'tests/Application/*']
2312
triggered_by: ['php']
2413
phpmd:
14+
exclude: ['migrations']
2515
ruleset: ['ruleset/.php_md.xml']
2616
phpstan:
2717
level: ~
2818
configuration: 'ruleset/phpstan.neon'
29-
securitychecker_symfony: ~
19+
use_grumphp_paths: false
3020
yamllint:
3121
parse_custom_tags: true
3222
ecs:
@@ -35,3 +25,10 @@ grumphp:
3525
twigcs:
3626
path: 'src/'
3727
severity: error
28+
phpcs:
29+
standard: "ruleset"
30+
warning_severity: 0
31+
whitelist_patterns:
32+
- 'src'
33+
exclude:
34+
- 'PSR12.Files.FileHeader'

ruleset/phpstan.neon

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
parameters:
22
level: 8
33
reportUnmatchedIgnoredErrors: false
4-
checkMissingIterableValueType: false
5-
checkGenericClassInNonGenericObjectType: false
4+
paths:
5+
- ../src
66
excludePaths:
7-
# Makes PHPStan crash
8-
- ../src/DependencyInjection/Configuration.php
9-
- ../src/Migrations/
10-
11-
# Test dependencies
7+
- ../src/DependencyInjection/Configuration.php?
8+
- ../src/Migrations?
129
- ../tests
13-
14-
# PHPSpec
1510
- ../spec
1611

1712
ignoreErrors:
13+
- identifier: missingType.iterableValue
14+
- identifier: missingType.generics
1815
- '/Parameter #1 \$configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration\(\) expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface\|null given./'
1916
- '#^Method [\w\\]+Type::render\(\) has parameter \$[\w]+ with no typehint specified.$#'
2017
- '#Variable method call on Synolia\\SyliusSchedulerCommandPlugin\\Entity\\ScheduledCommand.#'

ruleset/rector.php

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,30 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Set\ValueObject\LevelSetList;
6+
use Rector\Set\ValueObject\SetList;
7+
use Rector\Symfony\Set\SymfonySetList;
78

8-
return static function (RectorConfig $rectorConfig): void {
9-
$rectorConfig->paths([
10-
dirname(__DIR__) . '/src',
11-
dirname(__DIR__) . '/spec',
12-
dirname(__DIR__) . '/tests/Behat',
13-
dirname(__DIR__) . '/tests/PHPUnit',
9+
return RectorConfig::configure()
10+
->withPaths([
11+
\dirname(__DIR__) . '/src',
12+
\dirname(__DIR__) . '/tests/PHPUnit',
13+
])
14+
->withPHPStanConfigs([__DIR__ . '/phpstan.neon'])
15+
->withPhpSets(php82: true)
16+
->withAttributesSets(symfony: true, doctrine: true)
17+
->withPreparedSets(
18+
deadCode: true,
19+
codeQuality: true,
20+
doctrineCodeQuality: true,
21+
symfonyConfigs: true,
22+
)
23+
->withTypeCoverageLevel(0)
24+
->withSets([
25+
SymfonySetList::SYMFONY_60,
26+
SymfonySetList::SYMFONY_61,
27+
SymfonySetList::SYMFONY_62,
28+
SymfonySetList::SYMFONY_63,
29+
SymfonySetList::SYMFONY_64,
30+
SetList::CODE_QUALITY,
31+
SetList::DEAD_CODE,
1432
]);
15-
16-
$rectorConfig->sets([
17-
LevelSetList::UP_TO_PHP_74,
18-
LevelSetList::UP_TO_PHP_80
19-
]);
20-
};

ruleset/ruleset.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd">
4+
<arg name="colors"/>
5+
<arg name="extensions" value="php"/>
6+
<rule ref="PSR12"/>
7+
8+
<rule ref="Generic.PHP.ForbiddenFunctions">
9+
<properties>
10+
<property name="forbiddenFunctions" type="array">
11+
<element key="dd" value="null"/>
12+
<element key="die" value="null"/>
13+
<element key="dump" value="null"/>
14+
<element key="print_r" value="null"/>
15+
<element key="var_dump" value="null"/>
16+
</property>
17+
</properties>
18+
</rule>
19+
</ruleset>

0 commit comments

Comments
 (0)