Skip to content

Commit

Permalink
refactor #110 [Maintenance] Allow installing Symfony 7 (NoResponseMate)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.9 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.9
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | -
| License         | MIT


Commits
-------

e434167 [Maintenance] Allow installing Symfony 7
10b1610 [Maintenance] Update ecs config
10d64fd [Maintenance] Swap psalm for phpstan
c35304d [Maintenance] Use promoted properties
d6319cd [Maintenance] Update copyright and licence
0ba9d06 [Maintenance] Drop support for PHP 8.0
  • Loading branch information
lchrusciel authored Jul 30, 2024
2 parents afcc410 + 0ba9d06 commit 53ed323
Show file tree
Hide file tree
Showing 86 changed files with 253 additions and 269 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "^6.0"]
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4", "^7.0"]
dbal: ["^2.0", "^3.0"]
exclude:
-
php: "8.1"
symfony: "^7.0"
-
symfony: "^7.0"
dbal: "^2.0"

steps:
-
uses: actions/checkout@v2
uses: actions/checkout@v4

-
name: Setup PHP
Expand All @@ -37,7 +44,7 @@ jobs:
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:1.18.5"
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.17 || ^2.0"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2019 Paweł Jędrzejewski
Copyright (c) 2011-present Sylius Sp. z o.o.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 15 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,27 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"doctrine/data-fixtures": "^1.2",
"monolog/monolog": "^1.25 || ^2.1",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/monolog-bridge": "^5.4 || ^6.0",
"monolog/monolog": "^1.25 || ^2.1 || ^3",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0",
"webmozart/assert": "^1.9"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.1",
"doctrine/orm": "^2.7",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"doctrine/orm": "^2.7 || ^3.0",
"matthiasnoback/symfony-config-test": "^4.2 || ^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.2 || ^5.0",
"phpspec/phpspec": "^7.0",
"phpunit/phpunit": "^9.4",
"sylius-labs/coding-standard": "^4.0",
"vimeo/psalm": "^4.23",
"rector/rector": "^0.14.5"
"rector/rector": "^0.14.5",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpstan/phpstan-symfony": "^1.3",
"phpstan/phpstan-phpunit": "^1.3"
},
"extra": {
"branch-alias": {
Expand All @@ -61,8 +65,8 @@
"scripts": {
"analyse": [
"@composer validate --strict",
"vendor/bin/ecs check spec src tests",
"vendor/bin/psalm"
"vendor/bin/ecs check",
"vendor/bin/phpstan analyse"
],
"fix": [
"vendor/bin/ecs check spec src tests --fix"
Expand Down
17 changes: 0 additions & 17 deletions easy-coding-standard.yml

This file was deleted.

39 changes: 22 additions & 17 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,34 @@

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer;
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ContainerConfigurator $containerConfigurator): void
{
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');
return static function (ECSConfig $config): void {
$config->import('vendor/sylius-labs/coding-standard/ecs.php');

$containerConfigurator->services()->set(HeaderCommentFixer::class)->call('configure', [[
'location' => 'after_open',
'header' =>
'This file is part of the Sylius package.
$config->parallel();
$config->paths(['src', 'spec', 'tests']);

(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.',
]]);

$containerConfigurator->parameters()->set(Option::SKIP, [
$config->skip([
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
VisibilityRequiredFixer::class => ['*Spec.php'],
'**/var/*',
]);

$config->ruleWithConfiguration(
HeaderCommentFixer::class,
[
'location' => 'after_open',
'comment_type' => HeaderCommentFixer::HEADER_COMMENT,
'header' => <<<TEXT
This file is part of the Sylius package.
(c) Sylius Sp. z o.o.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
TEXT
]
);
};
26 changes: 26 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon

parameters:
level: 6

reportUnmatchedIgnoredErrors: false

paths:
- 'src/'
- 'tests/'

excludePaths:
- 'tests/Application/**.php'

ignoreErrors:
- '/Property .*\:\:\$container has no type specified\./'
- '/Static property .*\:\:\$container \(.*\\Test\\TestContainer\) does not accept Symfony\\Component\\DependencyInjection\\ContainerInterface\./'
- '/PHPDoc tag \@var for variable \$manager contains unknown class Doctrine\\ODM\\MongoDB\\DocumentManager\./'
- '/PHPDoc tag \@var for variable \$manager contains unknown class Doctrine\\ODM\\PHPCR\\DocumentManagerInterface\./'
17 changes: 0 additions & 17 deletions psalm.xml

This file was deleted.

2 changes: 1 addition & 1 deletion spec/Fixture/FixtureNotFoundExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Fixture/FixtureRegistrySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Listener/ListenerNotFoundExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Listener/ListenerRegistrySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Listener/LoggerListenerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Listener/SuiteLoaderListenerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Loader/FixtureLoaderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Loader/HookableFixtureLoaderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Loader/HookableSuiteLoaderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Loader/SuiteLoaderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Suite/LazySuiteRegistrySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Suite/PriorityQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Suite/SuiteFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Suite/SuiteNotFoundExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion spec/Suite/SuiteSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
15 changes: 5 additions & 10 deletions src/Command/FixturesListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -21,16 +21,11 @@

final class FixturesListCommand extends Command
{
private SuiteRegistryInterface $suiteRegistry;

private FixtureRegistryInterface $fixtureRegistry;

public function __construct(SuiteRegistryInterface $suiteRegistry, FixtureRegistryInterface $fixtureRegistry)
{
public function __construct(
private SuiteRegistryInterface $suiteRegistry,
private FixtureRegistryInterface $fixtureRegistry,
) {
parent::__construct(null);

$this->suiteRegistry = $suiteRegistry;
$this->fixtureRegistry = $fixtureRegistry;
}

protected function configure(): void
Expand Down
Loading

0 comments on commit 53ed323

Please sign in to comment.