Skip to content

Commit

Permalink
feat(upgrade): bump codebase to match sylius v[1.12|1.13|1.14]
Browse files Browse the repository at this point in the history
  • Loading branch information
maxperei committed Dec 30, 2024
1 parent 1d35dec commit fef29f9
Show file tree
Hide file tree
Showing 79 changed files with 343 additions and 427 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ jobs:
fail-fast: false
matrix:
php:
- 8.1
- 8.2
- 8.3
symfony:
- '5.4.*'
- '6.2.*'
- '6.4.*'
env:
APP_ENV: test
steps:
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,16 @@ jobs:
fail-fast: false
matrix:
php:
- 8.1
- 8.2
- 8.3
sylius:
- 1.10.0
- 1.12.0
- 1.13.0
- 1.14.0
symfony:
- 5.4
- 6.2
- 6.4
node:
- 14.x
exclude:
-
sylius: 1.10.0
symfony: 6.2
-
php: '8.0'
symfony: 6.2
env:
APP_ENV: test
package-name: synolia/sylius-scheduler-command-plugin
Expand Down Expand Up @@ -122,7 +115,7 @@ jobs:
run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
uses: actions/upload-artifact@v2.1.4
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
Expand Down
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
SHELL=/bin/bash
COMPOSER_ROOT=composer
TEST_DIRECTORY=tests/Application
CONSOLE=cd tests/Application && php bin/console -e test
COMPOSER=cd tests/Application && composer
YARN=cd tests/Application && yarn

SYLIUS_VERSION=1.12.0
SYMFONY_VERSION=6.1
PHP_VERSION=8.1
INSTALL_DIRECTORY=install/Application
CONSOLE=cd ${TEST_DIRECTORY} && php bin/console -e test
COMPOSER=cd ${TEST_DIRECTORY} && composer
YARN=cd ${TEST_DIRECTORY} && yarn

SYLIUS_VERSION=1.14.0
SYMFONY_VERSION=6.4
PHP_VERSION=8.2
PLUGIN_NAME=synolia/sylius-scheduler-command-plugin

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

reset: ## Remove dependencies
ifneq ("$(wildcard tests/Application/bin/console)","")
ifneq ("$(wildcard ${TEST_DIRECTORY}/bin/console)","")
${CONSOLE} doctrine:database:drop --force --if-exists || true
endif
rm -rf tests/Application
rm -rf ${TEST_DIRECTORY}
.PHONY: reset

phpunit: phpunit-configure phpunit-run ## Run PHPUnit
Expand Down Expand Up @@ -62,7 +63,7 @@ install-plugin:
${COMPOSER} config minimum-stability "dev"
${COMPOSER} config prefer-stable true
${COMPOSER} req ${PLUGIN_NAME}:* --prefer-source --no-scripts
cp -r install/Application tests
cp -r ${INSTALL_DIRECTORY} tests

install-sylius:
${CONSOLE} doctrine:database:create -n
Expand Down Expand Up @@ -97,7 +98,7 @@ grumphp: ## Run GrumPHP
vendor/bin/grumphp run

help: SHELL=/bin/bash
help: ## Dislay this help
help: ## Display this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

| | Version |
|:-------|:--------|
| PHP | ^8.0 |
| Sylius | ^1.10 |
| PHP | ^8.2 |
| Sylius | ^1.12 |

## Installation

Expand Down
84 changes: 42 additions & 42 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,54 @@
"description": "Scheduler Command Plugin.",
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.2",
"ext-json": "*",
"ext-intl": "*",
"dragonmantank/cron-expression": "^3.0",
"sylius/sylius": "^1.10",
"dragonmantank/cron-expression": "^3.4",
"sylius/sylius": "^1.12",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/lock": "^5.4|^6.0",
"symfony/lock": "^6.4",
"symfony/polyfill-intl-icu": "^1.26",
"symfony/process": "^5.4|^6.0",
"symfony/service-contracts": "^1.1|^2.0|^3.0",
"webmozart/assert": "^1.10"
"symfony/process": "^6.4",
"symfony/service-contracts": "^3.5",
"webmozart/assert": "^1.11"
},
"require-dev": {
"behat/behat": "3.12.0",
"behat/mink-selenium2-driver": "1.6.0",
"dmore/behat-chrome-extension": "1.4.0",
"dmore/chrome-mink-driver": "2.9.0",
"friends-of-behat/mink": "1.10.0",
"friends-of-behat/mink-browserkit-driver": "1.6.1",
"friends-of-behat/mink-debug-extension": "2.1.0",
"friends-of-behat/mink-extension": "2.7.2",
"friends-of-behat/page-object-extension": "0.3.2",
"friends-of-behat/suite-settings-extension": "1.1.0",
"friends-of-behat/symfony-extension": "2.4.0",
"friends-of-behat/variadic-extension": "1.5.0",
"friendsoftwig/twigcs": "6.0.0",
"j13k/yaml-lint": "1.1.4",
"php-parallel-lint/php-parallel-lint": "1.3.2",
"phpmd/phpmd": "2.13.0",
"phpro/grumphp": "1.15.0",
"phpspec/phpspec": "7.3.0",
"phpstan/extension-installer": "1.2.0",
"phpstan/phpstan": "1.9.5",
"phpstan/phpstan-doctrine": "1.3.28",
"phpstan/phpstan-strict-rules": "1.4.4",
"phpstan/phpstan-webmozart-assert": "1.2.2",
"phpunit/phpunit": "9.5.27",
"rector/rector": "^0.15.2",
"sebastian/phpcpd": "6.0.3",
"seld/jsonlint": "1.9.0",
"slevomat/coding-standard": "8.7.1",
"sylius-labs/coding-standard": "4.3.0",
"symfony/browser-kit": "6.0.11",
"symfony/debug-bundle": "6.0.11",
"symfony/dotenv": "6.0.5",
"symfony/intl": "6.0.15",
"symfony/web-profiler-bundle": "6.0.17",
"symplify/easy-coding-standard": "11.1.32.72"
"behat/behat": "^3.12",
"behat/mink-selenium2-driver": "^1.6",
"dmore/behat-chrome-extension": "^1.4",
"dmore/chrome-mink-driver": "^2.9",
"friends-of-behat/mink": "^1.10",
"friends-of-behat/mink-browserkit-driver": "^1.6",
"friends-of-behat/mink-debug-extension": "^2.1",
"friends-of-behat/mink-extension": "^2.7",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.1",
"friends-of-behat/symfony-extension": "^2.4",
"friends-of-behat/variadic-extension": "^1.5",
"friendsoftwig/twigcs": "6.4.0",
"j13k/yaml-lint": "^1.1",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpmd/phpmd": "^2.15.0",
"phpro/grumphp": "^2.9",
"phpspec/phpspec": "^7.3",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-doctrine": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^9.5",
"rector/rector": "^2.0",
"seld/jsonlint": "^1.11",
"slevomat/coding-standard": "^8.7",
"squizlabs/php_codesniffer": "^3.11",
"sylius-labs/coding-standard": "^4.3",
"symfony/browser-kit": "^6.4",
"symfony/debug-bundle": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/intl": "^6.4",
"symfony/web-profiler-bundle": "^6.4",
"symplify/easy-coding-standard": "^12.5"
},
"suggest": {
"lorisleiva/cron-translator": "Allow showing humanized and translated cron expression."
Expand Down
5 changes: 5 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
imports:
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/config/resources.yaml" }
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/config/grids.yaml" }
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/config/services.yaml" }
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/config/ui.yaml" }
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions config/routes/admin/attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
controllers:
resource:
path: ../../../src/Controller/
namespace: Synolia\SyliusSchedulerCommandPlugin\Controller
type: attribute
25 changes: 25 additions & 0 deletions config/routes/admin/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
synolia_admin_commands:
resource: |
alias: synolia.command
templates: "@SyliusAdmin\\Crud"
section: admin
grid: synolia_admin_commands
except: ['show']
permission: true
vars:
index:
icon: 'box'
type: sylius.resource

synolia_admin_scheduled_commands:
resource: |
alias: synolia.scheduled_command
templates: "@SyliusAdmin\\Crud"
section: admin
grid: synolia_admin_scheduled_commands
except: ['update', 'show']
permission: true
vars:
index:
icon: 'box'
type: sylius.resource
13 changes: 13 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
env(SYNOLIA_SCHEDULER_PLUGIN_PING_INTERVAL): 300
env(SYNOLIA_SCHEDULER_PLUGIN_KEEP_ALIVE): true
env(SYNOLIA_SCHEDULER_PLUGIN_LOGS_DIR): '%kernel.logs_dir%'

services:
_defaults:
autowire: true
autoconfigure: true

Synolia\SyliusSchedulerCommandPlugin\:
resource: '../src/*'
exclude: '../src/{Entity,SynoliaSyliusSchedulerCommandPlugin.php}'
File renamed without changes.
File renamed without changes.
23 changes: 10 additions & 13 deletions grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,18 @@ grumphp:
tasks:
composer:
no_check_all: true
git_blacklist:
keywords:
- 'var_dump'
- 'dump\('
- 'print_r'
- 'die\('
- 'console\.'
triggered_by: [php, twig, js]
jsonlint:
detect_key_conflicts: true
phpcpd:
directory:
- src
phplint:
exclude: ['vendor']
exclude: ['vendor', 'tests/Application/*']
triggered_by: ['php']
phpmd:
exclude: ['migrations']
ruleset: ['ruleset/.php_md.xml']
phpstan:
level: ~
configuration: 'ruleset/phpstan.neon'
securitychecker_symfony: ~
use_grumphp_paths: false
yamllint:
parse_custom_tags: true
ecs:
Expand All @@ -35,3 +25,10 @@ grumphp:
twigcs:
path: 'src/'
severity: error
phpcs:
standard: "ruleset"
warning_severity: 0
whitelist_patterns:
- 'src'
exclude:
- 'PSR12.Files.FileHeader'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/Resources/config/config.yaml" }
- { resource: "@SynoliaSyliusSchedulerCommandPlugin/config/config.yaml" }
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
synolia_scheduled_command:
resource: "@SynoliaSyliusSchedulerCommandPlugin/Resources/config/admin_routing.yaml"
resource: "@SynoliaSyliusSchedulerCommandPlugin/config/routes/admin/**.yaml"
prefix: '/%sylius_admin.path_name%'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 6 additions & 9 deletions ruleset/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
parameters:
level: 8
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- ../src
excludePaths:
# Makes PHPStan crash
- ../src/DependencyInjection/Configuration.php
- ../src/Migrations/

# Test dependencies
- ../src/DependencyInjection/Configuration.php?
- ../migrations
- ../tests

# PHPSpec
- ../spec

ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '/Parameter #1 \$configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration\(\) expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface\|null given./'
- '#^Method [\w\\]+Type::render\(\) has parameter \$[\w]+ with no typehint specified.$#'
- '#Variable method call on Synolia\\SyliusSchedulerCommandPlugin\\Entity\\ScheduledCommand.#'
Expand Down
38 changes: 25 additions & 13 deletions ruleset/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
dirname(__DIR__) . '/src',
dirname(__DIR__) . '/spec',
dirname(__DIR__) . '/tests/Behat',
dirname(__DIR__) . '/tests/PHPUnit',
return RectorConfig::configure()
->withPaths([
\dirname(__DIR__, 1) . '/src',
\dirname(__DIR__, 1) . '/tests/PHPUnit',
])
->withPHPStanConfigs([__DIR__ . '/phpstan.neon'])
->withPhpSets(php82: true)
->withAttributesSets(symfony: true, doctrine: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
doctrineCodeQuality: true,
symfonyConfigs: true,
)
->withTypeCoverageLevel(0)
->withSets([
SymfonySetList::SYMFONY_60,
SymfonySetList::SYMFONY_61,
SymfonySetList::SYMFONY_62,
SymfonySetList::SYMFONY_63,
SymfonySetList::SYMFONY_64,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
LevelSetList::UP_TO_PHP_80
]);
};
Loading

0 comments on commit fef29f9

Please sign in to comment.