From 26a3868497b6cb546b464f099172499a3eb44770 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 26 Jul 2022 08:23:12 +0200 Subject: [PATCH 01/18] Add support for symfony 6 --- .github/workflows/test-application.yaml | 6 +++++ composer.json | 32 ++++++++++++------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 262ed179..363418c9 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -45,6 +45,12 @@ jobs: env: SYMFONY_DEPRECATIONS_HELPER: weak + - php-version: '8.1' + coverage: false + dependency-versions: 'highest' + env: + SYMFONY_DEPRECATIONS_HELPER: weak + services: mysql: image: mysql:5.7 diff --git a/composer.json b/composer.json index f20e8e7f..df7b3688 100644 --- a/composer.json +++ b/composer.json @@ -19,19 +19,19 @@ "doctrine/doctrine-bundle": "^1.10 || ^2.0", "friendsofsymfony/rest-bundle": "^2.6 || ^3.0", "massive/search-bundle": "^2.4", - "ramsey/uuid": "^3.8", + "ramsey/uuid": "^3.8 || ^4.0", "sulu/sulu": "^2.1 || ^2.3@dev", - "symfony/config": "^4.4 || ^5.0", - "symfony/dependency-injection": "^4.4 || ^5.0", - "symfony/event-dispatcher": "^4.4 || ^5.0", - "symfony/http-foundation": "^4.4 || ^5.0", - "symfony/http-kernel": "^4.4 || ^5.0", - "symfony/options-resolver": "^4.4 || ^5.0", - "symfony/property-access": "^4.4 || ^5.0", - "symfony/security-core": "^4.4 || ^5.0", - "symfony/serializer": "^4.4 || ^5.0", + "symfony/config": "^4.4 || ^5.4 || ^6.0", + "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0", + "symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0", + "symfony/http-foundation": "^4.4 || ^5.4 || ^6.0", + "symfony/http-kernel": "^4.4 || ^5.4 || ^6.0", + "symfony/options-resolver": "^4.4 || ^5.4 || ^6.0", + "symfony/property-access": "^4.4 || ^5.4 || ^6.0", + "symfony/security-core": "^4.4 || ^5.4 || ^6.0", + "symfony/serializer": "^4.4 || ^5.4 || ^6.0", "symfony/translation-contracts": "^1.0 || ^2.0", - "symfony/workflow": "^4.4 || ^5.0", + "symfony/workflow": "^4.4 || ^5.4 || ^6.0", "webmozart/assert": "^1.3" }, "require-dev": { @@ -52,14 +52,14 @@ "phpstan/phpstan-webmozart-assert": "^0.12", "qossmic/deptrac-shim": "^0.11.1", "sulu/automation-bundle": "^2.0@dev", - "symfony/browser-kit": "^4.4 || ^5.0", - "symfony/console": "^4.4 || ^5.0", + "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", + "symfony/console": "^4.4 || ^5.4 || ^6.0", "symfony/debug": "^4.4", - "symfony/dotenv": "^4.4 || ^5.0", - "symfony/framework-bundle": "^4.4 || ^5.0", + "symfony/dotenv": "^4.4 || ^5.4 || ^6.0", + "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0", "symfony/monolog-bundle": "^3.1", "symfony/phpunit-bridge": "^5.2", - "symfony/string": "^4.4 || ^5.0", + "symfony/string": "^4.4 || ^5.4 || ^6.0", "thecodingmachine/phpstan-strict-rules": "^0.12" }, "conflict": { From 9cdc502232362751301f01c8504d85e6bdf2a993 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 26 Jul 2022 08:27:50 +0200 Subject: [PATCH 02/18] Fix indent. --- .github/workflows/test-application.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 363418c9..ce18fdc0 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -46,10 +46,10 @@ jobs: SYMFONY_DEPRECATIONS_HELPER: weak - php-version: '8.1' - coverage: false - dependency-versions: 'highest' - env: - SYMFONY_DEPRECATIONS_HELPER: weak + coverage: false + dependency-versions: 'highest' + env: + SYMFONY_DEPRECATIONS_HELPER: weak services: mysql: From 7b1ffe14f38f8748adb6619eb4db6525c0db9c6f Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 1 Aug 2022 10:43:53 +0200 Subject: [PATCH 03/18] Remove deprecated debug component --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index df7b3688..5f4b816c 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,6 @@ "sulu/automation-bundle": "^2.0@dev", "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", "symfony/console": "^4.4 || ^5.4 || ^6.0", - "symfony/debug": "^4.4", "symfony/dotenv": "^4.4 || ^5.4 || ^6.0", "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0", "symfony/monolog-bundle": "^3.1", From 52ffd8bba6de230f553178e8e04a67465dcda60d Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Mon, 1 Aug 2022 21:14:10 +0200 Subject: [PATCH 04/18] Add missing return types. --- Tests/Application/Kernel.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Application/Kernel.php b/Tests/Application/Kernel.php index 0f82fc54..193e60a5 100644 --- a/Tests/Application/Kernel.php +++ b/Tests/Application/Kernel.php @@ -23,7 +23,7 @@ class Kernel extends SuluTestKernel { - public function registerBundles() + public function registerBundles(): iterable { $bundles = parent::registerBundles(); $bundles[] = new SuluContentBundle(); @@ -43,13 +43,13 @@ public function registerBundles() return $bundles; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { parent::registerContainerConfiguration($loader); $loader->load(__DIR__ . '/config/config_' . $this->getContext() . '.yml'); } - protected function getKernelParameters() + protected function getKernelParameters(): array { $parameters = parent::getKernelParameters(); From 9f1c6303d578ffa6d8c02794707d96afff1d412a Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Mon, 1 Aug 2022 21:20:46 +0200 Subject: [PATCH 05/18] Update qossmic/deptrac-shim for php 8.1 comparability. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5f4b816c..1e77eeca 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-symfony": "^0.12", "phpstan/phpstan-webmozart-assert": "^0.12", - "qossmic/deptrac-shim": "^0.11.1", + "qossmic/deptrac-shim": "^0.23.0", "sulu/automation-bundle": "^2.0@dev", "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", "symfony/console": "^4.4 || ^5.4 || ^6.0", From 0e707833b666896bc0e1159e5b6c144e3a8ecb18 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 2 Aug 2022 06:59:31 +0200 Subject: [PATCH 06/18] Let php 7.2 use older version from qossmic/deptrac-shim. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1e77eeca..0a15a2c9 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-symfony": "^0.12", "phpstan/phpstan-webmozart-assert": "^0.12", - "qossmic/deptrac-shim": "^0.23.0", + "qossmic/deptrac-shim": "^0.11.1 || ^0.23.0", "sulu/automation-bundle": "^2.0@dev", "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", "symfony/console": "^4.4 || ^5.4 || ^6.0", From 553510525f2009d16c17a1309badb9e4d25c11e5 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 2 Aug 2022 07:01:16 +0200 Subject: [PATCH 07/18] remove swiftmailer config --- Tests/Application/config/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Application/config/config.yml b/Tests/Application/config/config.yml index 8180da20..0e0f8754 100644 --- a/Tests/Application/config/config.yml +++ b/Tests/Application/config/config.yml @@ -1,5 +1,5 @@ -swiftmailer: - disable_delivery: true +framework: + profiler: { enabled: true, collect: false } doctrine: orm: From d778573a2bd7cf8e8d8fe6642c90548fbede1ac8 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 2 Aug 2022 12:57:47 +0200 Subject: [PATCH 08/18] Fix fos js routing --- Tests/Application/config/routing_admin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Application/config/routing_admin.yml b/Tests/Application/config/routing_admin.yml index b5d5d280..0ff04a87 100644 --- a/Tests/Application/config/routing_admin.yml +++ b/Tests/Application/config/routing_admin.yml @@ -1,7 +1,7 @@ # FosJsRoutingBundle fos_js_routing: prefix: /admin - resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" + resource: "@FOSJsRoutingBundle/Resources/config/routing/routing-sf4.xml" # Sulu sulu_tag_api: From dad82526a21082bc6385a18c4fb3e71781fee82f Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Tue, 2 Aug 2022 15:10:30 +0200 Subject: [PATCH 09/18] Repacle 'self::->get' --- .../Content/Infrastructure/Doctrine/CategoryFactoryTest.php | 2 +- .../Doctrine/DimensionContentRepositoryTest.php | 2 +- .../Content/Infrastructure/Doctrine/TagFactoryTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Functional/Content/Infrastructure/Doctrine/CategoryFactoryTest.php b/Tests/Functional/Content/Infrastructure/Doctrine/CategoryFactoryTest.php index 1760ea88..05db026e 100644 --- a/Tests/Functional/Content/Infrastructure/Doctrine/CategoryFactoryTest.php +++ b/Tests/Functional/Content/Infrastructure/Doctrine/CategoryFactoryTest.php @@ -27,7 +27,7 @@ protected function setUp(): void public function createCategoryFactory(): CategoryFactoryInterface { - return self::$container->get('sulu_content.category_factory'); + return self::getContainer()->get('sulu_content.category_factory'); } /** diff --git a/Tests/Functional/Content/Infrastructure/Doctrine/DimensionContentRepositoryTest.php b/Tests/Functional/Content/Infrastructure/Doctrine/DimensionContentRepositoryTest.php index 134325ed..b45d2703 100644 --- a/Tests/Functional/Content/Infrastructure/Doctrine/DimensionContentRepositoryTest.php +++ b/Tests/Functional/Content/Infrastructure/Doctrine/DimensionContentRepositoryTest.php @@ -29,7 +29,7 @@ protected function setUp(): void public function createContentDimensionRepository(): DimensionContentRepositoryInterface { - return self::$container->get('sulu_content.dimension_content_repository'); + return self::getContainer()->get('sulu_content.dimension_content_repository'); } public function testLoadExistAll(): void diff --git a/Tests/Functional/Content/Infrastructure/Doctrine/TagFactoryTest.php b/Tests/Functional/Content/Infrastructure/Doctrine/TagFactoryTest.php index 2c36a8e2..e3764601 100644 --- a/Tests/Functional/Content/Infrastructure/Doctrine/TagFactoryTest.php +++ b/Tests/Functional/Content/Infrastructure/Doctrine/TagFactoryTest.php @@ -31,7 +31,7 @@ protected function setUp(): void self::bootKernel(); self::purgeDatabase(); - $this->tagFactory = self::$container->get('sulu_content.tag_factory'); + $this->tagFactory = self::getContainer()->get('sulu_content.tag_factory'); } /** @@ -72,7 +72,7 @@ public function testCreateSameTagTwiceWithOtherEntityInUnitOfWork(): void $this->getEntityManager()->persist($this->createOtherEntity()); /** @var TagRepositoryInterface $tagRepository */ - $tagRepository = self::$container->get('sulu.repository.tag'); + $tagRepository = self::getContainer()->get('sulu.repository.tag'); $tag = $tagRepository->createNew(); $tag->setName('Other Tag'); $this->getEntityManager()->persist($tag); @@ -138,7 +138,7 @@ public function dataProvider(): \Generator private function createTags(array $existTagNames = []): void { /** @var TagRepositoryInterface $tagRepository */ - $tagRepository = self::$container->get('sulu.repository.tag'); + $tagRepository = self::getContainer()->get('sulu.repository.tag'); foreach ($existTagNames as $existTagName) { $existTag = $tagRepository->createNew(); From 64eda528d38ffa71711b6f1524ba47eae54158ca Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Wed, 10 Aug 2022 18:50:02 +0200 Subject: [PATCH 10/18] Fix lint error --- Tests/Application/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Application/Kernel.php b/Tests/Application/Kernel.php index 193e60a5..25dc0d70 100644 --- a/Tests/Application/Kernel.php +++ b/Tests/Application/Kernel.php @@ -43,7 +43,7 @@ public function registerBundles(): iterable return $bundles; } - public function registerContainerConfiguration(LoaderInterface $loader): void + public function registerContainerConfiguration(LoaderInterface $loader) { parent::registerContainerConfiguration($loader); $loader->load(__DIR__ . '/config/config_' . $this->getContext() . '.yml'); From 1b8bae1039911c435dfaecd3d537a99bd533b8bd Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Wed, 10 Aug 2022 18:55:22 +0200 Subject: [PATCH 11/18] Run linters --- .../Search/ContentSearchMetadataProvider.php | 4 ++-- .../ContentWorkflow/ContentWorkflowTest.php | 16 ++++++++-------- composer.json | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php index 36cd1ed5..6c2a66dc 100644 --- a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php @@ -341,7 +341,7 @@ private function mapProperty(PropertyMetadata $property, IndexMetadata $metadata // @codeCoverageIgnoreStart $metadata->setImageUrlField($this->getContentField($property)); break; - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd default: // TODO FIXME add test case for this // @codeCoverageIgnoreStart @@ -352,7 +352,7 @@ private function mapProperty(PropertyMetadata $property, IndexMetadata $metadata implode(', ', ['title', 'description', 'image']) ) ); - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd } return; diff --git a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php index 3ef17fac..1cf3261e 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php @@ -54,14 +54,14 @@ protected function wrapWorkflowMock(ObjectProphecy $workflowMock) return new class($workflowMock) extends MockWrapper implements DimensionContentInterface, WorkflowInterface { - use DimensionContentMockWrapperTrait; - use WorkflowMockWrapperTrait; - - public static function getWorkflowName(): string - { - return 'content_workflow'; - } - }; + use DimensionContentMockWrapperTrait; + use WorkflowMockWrapperTrait; + + public static function getWorkflowName(): string + { + return 'content_workflow'; + } + }; } public function testTransitionNoWorkflowInterface(): void diff --git a/composer.json b/composer.json index 0a15a2c9..3e8fb66f 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,6 @@ "check-coverage": [ "@php vendor/bin/code-coverage-checker \"Tests/reports/coverage.php\" \"line\" \"100.00\" \"Content\" \"DependencyInjection\"" ], - "deptract": "vendor/bin/deptrac", "phpstan": [ "Tests/Application/bin/adminconsole cache:warmup --env dev", "@test install", From 8d623bf8b84e8fd78707507cad45b13a4dbbc8a8 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Fri, 30 Sep 2022 12:06:08 +0200 Subject: [PATCH 12/18] update some outdated packages --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 3e8fb66f..0a7ff6dc 100644 --- a/composer.json +++ b/composer.json @@ -14,13 +14,13 @@ "php": "^7.2 || ^8.0", "doctrine/inflector": "^1.4.1 || ^2.0.1", "doctrine/collections": "^1.0", - "doctrine/orm": "^2.5.3", + "doctrine/orm": "^2.8", "doctrine/persistence": "^1.3 || ^2.0", "doctrine/doctrine-bundle": "^1.10 || ^2.0", "friendsofsymfony/rest-bundle": "^2.6 || ^3.0", - "massive/search-bundle": "^2.4", + "massive/search-bundle": "^2.6", "ramsey/uuid": "^3.8 || ^4.0", - "sulu/sulu": "^2.1 || ^2.3@dev", + "sulu/sulu": "^2.1 || ^2.6@dev", "symfony/config": "^4.4 || ^5.4 || ^6.0", "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0", "symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0", @@ -30,7 +30,7 @@ "symfony/property-access": "^4.4 || ^5.4 || ^6.0", "symfony/security-core": "^4.4 || ^5.4 || ^6.0", "symfony/serializer": "^4.4 || ^5.4 || ^6.0", - "symfony/translation-contracts": "^1.0 || ^2.0", + "symfony/translation-contracts": "^1.0 || ^2.0 || ^3.0", "symfony/workflow": "^4.4 || ^5.4 || ^6.0", "webmozart/assert": "^1.3" }, @@ -57,7 +57,7 @@ "symfony/dotenv": "^4.4 || ^5.4 || ^6.0", "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0", "symfony/monolog-bundle": "^3.1", - "symfony/phpunit-bridge": "^5.2", + "symfony/phpunit-bridge": "^5.4 || ^6.0", "symfony/string": "^4.4 || ^5.4 || ^6.0", "thecodingmachine/phpstan-strict-rules": "^0.12" }, From d7f8525d20d28c4bba044a487ce281e8f91c3c59 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 20:27:32 +0200 Subject: [PATCH 13/18] Undo some dependencies updates --- .../Search/ContentSearchMetadataProvider.php | 4 ++-- .../ContentWorkflow/ContentWorkflowTest.php | 16 ++++++++-------- composer.json | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php index 6c2a66dc..36cd1ed5 100644 --- a/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php +++ b/Content/Infrastructure/Sulu/Search/ContentSearchMetadataProvider.php @@ -341,7 +341,7 @@ private function mapProperty(PropertyMetadata $property, IndexMetadata $metadata // @codeCoverageIgnoreStart $metadata->setImageUrlField($this->getContentField($property)); break; - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd default: // TODO FIXME add test case for this // @codeCoverageIgnoreStart @@ -352,7 +352,7 @@ private function mapProperty(PropertyMetadata $property, IndexMetadata $metadata implode(', ', ['title', 'description', 'image']) ) ); - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd } return; diff --git a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php index 1cf3261e..3ef17fac 100644 --- a/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php +++ b/Tests/Unit/Content/Application/ContentWorkflow/ContentWorkflowTest.php @@ -54,14 +54,14 @@ protected function wrapWorkflowMock(ObjectProphecy $workflowMock) return new class($workflowMock) extends MockWrapper implements DimensionContentInterface, WorkflowInterface { - use DimensionContentMockWrapperTrait; - use WorkflowMockWrapperTrait; - - public static function getWorkflowName(): string - { - return 'content_workflow'; - } - }; + use DimensionContentMockWrapperTrait; + use WorkflowMockWrapperTrait; + + public static function getWorkflowName(): string + { + return 'content_workflow'; + } + }; } public function testTransitionNoWorkflowInterface(): void diff --git a/composer.json b/composer.json index 0a7ff6dc..73d42a99 100644 --- a/composer.json +++ b/composer.json @@ -14,11 +14,11 @@ "php": "^7.2 || ^8.0", "doctrine/inflector": "^1.4.1 || ^2.0.1", "doctrine/collections": "^1.0", - "doctrine/orm": "^2.8", + "doctrine/orm": "^2.5.3", "doctrine/persistence": "^1.3 || ^2.0", "doctrine/doctrine-bundle": "^1.10 || ^2.0", "friendsofsymfony/rest-bundle": "^2.6 || ^3.0", - "massive/search-bundle": "^2.6", + "massive/search-bundle": "^2.4", "ramsey/uuid": "^3.8 || ^4.0", "sulu/sulu": "^2.1 || ^2.6@dev", "symfony/config": "^4.4 || ^5.4 || ^6.0", From 7a0b48618181cd46be1ac1c40b703555b5d41531 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 20:41:16 +0200 Subject: [PATCH 14/18] Fix Unit tests --- composer.json | 1 + phpunit.xml.dist | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 73d42a99..90208c05 100644 --- a/composer.json +++ b/composer.json @@ -45,6 +45,7 @@ "jangregor/phpstan-prophecy": "^0.8", "matthiasnoback/symfony-config-test": "^4.0", "matthiasnoback/symfony-dependency-injection-test": "^4.0", + "phpspec/prophecy": "^1.0", "phpstan/phpstan": "^0.12", "phpstan/phpstan-doctrine": "^0.12", "phpstan/phpstan-phpunit": "^0.12", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 49d56651..5e204c74 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -31,4 +31,8 @@ + + + + From 938f483b82c2086af482cac15611807833205b45 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 21:10:47 +0200 Subject: [PATCH 15/18] Update prophecy --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 90208c05..55a92671 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "jangregor/phpstan-prophecy": "^0.8", "matthiasnoback/symfony-config-test": "^4.0", "matthiasnoback/symfony-dependency-injection-test": "^4.0", - "phpspec/prophecy": "^1.0", + "phpspec/prophecy": "^1.14", "phpstan/phpstan": "^0.12", "phpstan/phpstan-doctrine": "^0.12", "phpstan/phpstan-phpunit": "^0.12", From bf8f16e0036eb60ab78f38a16a6364e35bb6a1aa Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 21:41:23 +0200 Subject: [PATCH 16/18] Add PHP Lint task --- .github/workflows/test-application.yaml | 38 +++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index ce18fdc0..4e2ca212 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -22,7 +22,6 @@ jobs: matrix: include: - php-version: '7.2' - lint: false coverage: false dependency-versions: 'lowest' tools: 'composer:v1' @@ -30,7 +29,6 @@ jobs: SYMFONY_DEPRECATIONS_HELPER: disabled - php-version: '7.4' - lint: true coverage: true dependency-versions: 'highest' tools: 'composer:v2' @@ -38,7 +36,6 @@ jobs: SYMFONY_DEPRECATIONS_HELPER: weak - php-version: '8.0' - lint: false coverage: false dependency-versions: 'highest' tools: 'composer:v2' @@ -73,7 +70,7 @@ jobs: tools: ${{ matrix.tools }} - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v2 with: dependency-versions: ${{ matrix.dependency-versions }} composer-options: ${{ matrix.composer-options }} @@ -81,10 +78,6 @@ jobs: - name: Bootstrap test environment run: composer bootstrap-test-environment - - name: Lint Code - if: ${{ matrix.lint }} - run: composer lint - - name: Execute test cases if: matrix.coverage == false run: composer test @@ -104,3 +97,32 @@ jobs: - name: Check code coverage if: ${{ matrix.coverage }} run: composer check-coverage + + lint: + name: 'PHP Lint' + runs-on: ubuntu-latest + + env: + DATABASE_URL: mysql://root:root@127.0.0.1:3306/su_headless_test?serverVersion=5.7 + DATABASE_CHARSET: utf8mb4 + DATABASE_COLLATE: utf8mb4_unicode_ci + + steps: + - name: Checkout project + uses: actions/checkout@v2 + + - name: Install and configure PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: ctype, iconv, mysql + tools: 'composer:v2' + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: 'highest' + + - name: Lint Code + if: ${{ matrix.lint }} + run: composer lint From 4341e0e1823919558317bb336203a74d350756e5 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 21:51:36 +0200 Subject: [PATCH 17/18] Add php-cs-fixer 3 to fix symfony dependencies problem --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 55a92671..5c3d5ec0 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "coduo/php-matcher": "^3.2 || ^4.0 || ^5.0 || ^6.0", "doctrine/data-fixtures": "^1.3.3", "doctrine/doctrine-fixtures-bundle": "^2.0 || ^3.0", - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^2.17 || ^3.0", "handcraftedinthealps/code-coverage-checker": "^0.2.1", "handcraftedinthealps/zendsearch": "^2.0", "jackalope/jackalope-doctrine-dbal": "^1.3.4", From eda730fcaf8f44a65ee08b50246ce6c535a6c798 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 3 Oct 2022 21:54:00 +0200 Subject: [PATCH 18/18] Fix CI title --- .github/workflows/test-application.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 4e2ca212..e62a307a 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -9,7 +9,7 @@ on: jobs: test: - name: 'PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }}, Lint ${{ matrix.lint }}, Coverage ${{ matrix.coverage }})' + name: 'PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }}, Coverage ${{ matrix.coverage }})' runs-on: ubuntu-latest env: