Skip to content

Commit

Permalink
Add support for Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Mar 16, 2022
1 parent 898ca96 commit 92e9e55
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 40 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,37 @@ jobs:
matrix:
include:
-
php: 7.4
symfony: ^4.4
php: "7.4"
symfony: "^4.4"
-
php: 7.4
symfony: ^5.2
php: "7.4"
symfony: "^5.2"
-
php: 8.0
symfony: ^4.4
php: "8.0"
symfony: "^4.4"
-
php: 8.0
symfony: ^5.2
php: "8.0"
symfony: "^5.2"
-
php: 8.1
symfony: ^4.4
php: "8.0"
symfony: "^6.0"
-
php: 8.1
symfony: ^5.2
php: "8.1"
symfony: "^4.4"
-
php: 7.4
symfony: ^4.4
twig: ^2.12
php: "8.1"
symfony: "^5.2"
-
php: 7.4
symfony: ^5.2
twig: ^3.0
php: "8.1"
symfony: "^6.0"
-
php: "7.4"
symfony: "^4.4"
twig: "^2.12"
-
php: "7.4"
symfony: "^5.2"
twig: "^3.0"

steps:
-
Expand Down Expand Up @@ -86,6 +92,14 @@ jobs:
composer analyse
(cd src/Component && composer validate --strict)
-
name: Run Psalm
run: vendor/bin/psalm --show-info=false --output-format=github --php-version=${{ matrix.php }}

-
name: Run PHPStan
run: vendor/bin/phpstan analyse --ansi -c phpstan.neon -l max src

-
name: Run component tests
run: (cd src/Component && vendor/bin/phpspec run)
Expand Down
26 changes: 12 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"gedmo/doctrine-extensions": "^2.4.12 || ^3.0",
"jms/serializer-bundle": "^3.5",
"sylius/registry": "^1.2",
"symfony/config": "^4.4 || ^5.2",
"symfony/expression-language": "^4.4 || ^5.2",
"symfony/form": "^4.4 || ^5.2",
"symfony/framework-bundle": "^4.4 || ^5.2",
"symfony/security-csrf": "^4.4 || ^5.2",
"symfony/translation": "^4.4 || ^5.2",
"symfony/twig-bundle": "^4.4 || ^5.2",
"symfony/validator": "^4.4 || ^5.2",
"symfony/yaml": "^4.4 || ^5.2",
"symfony/config": "^4.4 || ^5.2 || ^6.0",
"symfony/expression-language": "^4.4 || ^5.2 || ^6.0",
"symfony/form": "^4.4 || ^5.2 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.2 || ^6.0",
"symfony/security-csrf": "^4.4 || ^5.2 || ^6.0",
"symfony/translation": "^4.4 || ^5.2 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.2 || ^6.0",
"symfony/validator": "^4.4 || ^5.2 || ^6.0",
"symfony/yaml": "^4.4 || ^5.2 || ^6.0",
"webmozart/assert": "^1.8",
"willdurand/hateoas-bundle": "^2.0",
"winzou/state-machine-bundle": "^0.5"
Expand All @@ -65,8 +65,8 @@
"phpunit/phpunit": "^9.5",
"sylius-labs/coding-standard": "^3.0",
"sylius/grid-bundle": "^1.7",
"symfony/dependency-injection": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/dependency-injection": "^4.4 || ^5.2 || ^6.0",
"symfony/dotenv": "^4.4 || ^5.2 || ^6.0",
"symplify/easy-coding-standard": "^8.3",
"twig/twig": "^2.12 || ^3.0",
"vimeo/psalm": "4.7.0"
Expand Down Expand Up @@ -96,9 +96,7 @@
"scripts": {
"analyse": [
"@composer validate --strict",
"vendor/bin/ecs check src || true",
"vendor/bin/phpstan analyse --ansi -c phpstan.neon -l max src",
"vendor/bin/psalm"
"vendor/bin/ecs check src || true"
],
"fix": [
"vendor/bin/ecs check src --fix"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

final class TargetEntitiesResolver implements TargetEntitiesResolverInterface
{
public function resolve(array $resources): array
public function resolve(array $resourcesConfiguration): array
{
$interfaces = [];

foreach ($resources as $alias => $configuration) {
foreach ($resourcesConfiguration as $alias => $configuration) {
$model = $this->getModel($alias, $configuration);

$modelInterfaces = class_implements($model) ?: [];
Expand All @@ -43,7 +43,7 @@ public function resolve(array $resources): array
return (string) current($classes);
}, $interfaces);

foreach ($resources as $alias => $configuration) {
foreach ($resourcesConfiguration as $alias => $configuration) {
if (isset($configuration['classes']['interface'])) {
$model = $this->getModel($alias, $configuration);
$interface = $configuration['classes']['interface'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ interface TargetEntitiesResolverInterface
/**
* @return array Interface to class map.
*/
public function resolve(array $resourcesConfiguration): array;
public function resolve(array $resourcesConfigurationConfiguration): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function it_adds_doctrine_event_listener_tag_to_target_entities_resolver_
protected function registerCompilerPass(ContainerBuilder $container): void
{
$targetEntitiesResolver = new class() implements TargetEntitiesResolverInterface {
public function resolve(array $resourcesConfiguration): array
public function resolve(array $resourcesConfigurationConfiguration): array
{
if ($resourcesConfiguration === ['app.loremipsum' => ['classes' => ['model' => \stdClass::class, 'interface' => \Countable::class]]]) {
if ($resourcesConfigurationConfiguration === ['app.loremipsum' => ['classes' => ['model' => \stdClass::class, 'interface' => \Countable::class]]]) {
return [\Countable::class => \stdClass::class];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Component/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"doctrine/inflector": "^1.4 || ^2.0",
"gedmo/doctrine-extensions": "^2.4.12 || ^3.0",
"pagerfanta/core": "^2.4",
"symfony/event-dispatcher": "^4.4 || ^5.2",
"symfony/property-access": "^4.4 || ^5.2",
"symfony/event-dispatcher": "^4.4 || ^5.2 || ^6.0",
"symfony/property-access": "^4.4 || ^5.2 || ^6.0",
"winzou/state-machine": "^0.4"
},
"require-dev": {
Expand Down

0 comments on commit 92e9e55

Please sign in to comment.