From 1d2a2eede881f4a68bd11cc4ed5a5a7c1ea834b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Tue, 10 Oct 2023 10:38:00 +0200 Subject: [PATCH] Allow Symfony 6 --- .github/workflows/build.yml | 3 --- composer.json | 23 ++++++++++------------- src/DependencyInjection/Configuration.php | 5 +++-- src/Fixture/ApiAccessTokenFixture.php | 1 + src/Fixture/ApiClientFixture.php | 1 + 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 795c69f..610021f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,6 @@ on: pull_request: ~ release: types: [created] - schedule: - - - cron: "0 1 * * 6" # Run at 1am every Saturday workflow_dispatch: ~ jobs: diff --git a/composer.json b/composer.json index 1485d78..4b59748 100644 --- a/composer.json +++ b/composer.json @@ -28,9 +28,9 @@ "sylius-labs/doctrine-migrations-extra-bundle": "^0.1.3", "sylius-labs/polyfill-symfony-framework-bundle": "^1.0", "sylius/sylius": "~1.11.0 || ~1.12.0", - "symfony/form": "^5.4", - "symfony/framework-bundle": "^5.4", - "symfony/validator": "^5.4" + "symfony/form": "^5.4 || ^6.0", + "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/validator": "^5.4 || ^6.0" }, "require-dev": { "doctrine/data-fixtures": "^1.5", @@ -42,14 +42,14 @@ "phpspec/phpspec": "^7.0", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "psalm/plugin-symfony": "^3.1", - "symfony/browser-kit": "^5.4", - "symfony/debug-bundle": "^5.4", - "symfony/dependency-injection": "^5.4", - "symfony/dotenv": "^5.4", + "psalm/plugin-symfony": "5.0", + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/debug-bundle": "^5.4 || ^6.0", + "symfony/dependency-injection": "^5.4 || ^6.0", + "symfony/dotenv": "^5.4 || ^6.0", "symfony/monolog-bundle": "^3.7", - "symfony/web-profiler-bundle": "^5.4", - "vimeo/psalm": "^4.6.4" + "symfony/web-profiler-bundle": "^5.4 || ^6.0", + "vimeo/psalm": "^5.15" }, "config": { "sort-packages": true, @@ -61,9 +61,6 @@ "extra": { "branch-alias": { "dev-main": "1.13-dev" - }, - "symfony": { - "require": "^5.4" } }, "autoload": { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index abdddff..4079969 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -35,13 +35,13 @@ final class Configuration implements ConfigurationInterface public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('sylius_admin_api'); + /** @var ArrayNodeDefinition $rootNode */ $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() - ->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end() - ->end() + ->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM) ; $this->addResourcesSection($rootNode); @@ -51,6 +51,7 @@ public function getConfigTreeBuilder(): TreeBuilder private function addResourcesSection(ArrayNodeDefinition $node): void { + /** @psalm-suppress PossiblyUndefinedMethod */ $node ->children() ->arrayNode('resources') diff --git a/src/Fixture/ApiAccessTokenFixture.php b/src/Fixture/ApiAccessTokenFixture.php index 6df03ac..b177921 100644 --- a/src/Fixture/ApiAccessTokenFixture.php +++ b/src/Fixture/ApiAccessTokenFixture.php @@ -25,6 +25,7 @@ public function getName(): string protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void { + /** @psalm-suppress UndefinedInterfaceMethod,PossiblyUndefinedMethod */ $resourceNode ->children() ->scalarNode('client')->cannotBeEmpty()->end() diff --git a/src/Fixture/ApiClientFixture.php b/src/Fixture/ApiClientFixture.php index b8fbcf0..d869b8f 100644 --- a/src/Fixture/ApiClientFixture.php +++ b/src/Fixture/ApiClientFixture.php @@ -25,6 +25,7 @@ public function getName(): string protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void { + /** @psalm-suppress UndefinedInterfaceMethod,PossiblyUndefinedMethod */ $resourceNode ->children() ->scalarNode('random_id')->cannotBeEmpty()->end()