From fef4d0f45b235d8efb55825d387bbeb4193b573b Mon Sep 17 00:00:00 2001 From: Baptiste Leduc Date: Thu, 14 Mar 2024 14:18:05 +0100 Subject: [PATCH] Fix CI --- .github/workflows/ci.yaml | 2 +- .../Compiler/TransformerFactoryPass.php | 1 - tests/Resources/App/AppKernel.php | 16 +--------------- tests/ServiceInstantiationTest.php | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0b66e79..2170aa9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,4 +52,4 @@ jobs: env: SYMFONY_REQUIRE: "${{ matrix.symfony-versions }}" - name: tests - run: vendor/bin/phpunit + run: SYMFONY_DEPRECATIONS_HELPER="disabled=1" vendor/bin/simple-phpunit diff --git a/src/DependencyInjection/Compiler/TransformerFactoryPass.php b/src/DependencyInjection/Compiler/TransformerFactoryPass.php index fd02ce9..49c900d 100644 --- a/src/DependencyInjection/Compiler/TransformerFactoryPass.php +++ b/src/DependencyInjection/Compiler/TransformerFactoryPass.php @@ -4,7 +4,6 @@ use AutoMapper\Generator\Generator; use AutoMapper\Transformer\ChainTransformerFactory; -use AutoMapper\Transformer\CustomTransformer\CustomTransformerFactory; use AutoMapper\Transformer\CustomTransformer\CustomTransformerInterface; use AutoMapper\Transformer\CustomTransformer\CustomTransformersRegistry; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/tests/Resources/App/AppKernel.php b/tests/Resources/App/AppKernel.php index 329522a..9c29aef 100644 --- a/tests/Resources/App/AppKernel.php +++ b/tests/Resources/App/AppKernel.php @@ -13,8 +13,6 @@ use AutoMapper\Bundle\Tests\Fixtures\UserDTO; use AutoMapper\MapperGeneratorMetadataInterface; use AutoMapper\MapperMetadata; -use AutoMapper\Transformer\CustomTransformer\CustomModelTransformer; -use AutoMapper\Transformer\CustomTransformer\CustomModelTransformerInterface; use AutoMapper\Transformer\CustomTransformer\CustomPropertyTransformerInterface; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; @@ -40,22 +38,11 @@ public function registerBundles(): array return $bundles; } - private function configureRoutes(RoutingConfigurator $routes): void - { - $route = new Route('/', ['_controller' => 'kernel::indexAction']); - $routes->collection->add('index_action', $route); - } - protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $loader->load(__DIR__ . '/config.yml'); } - public function indexAction(): Response - { - return new Response(); - } - public function getProjectDir(): string { return __DIR__ . '/..'; @@ -67,7 +54,7 @@ class YearOfBirthTransformer implements CustomPropertyTransformerInterface { public function transform(object|array $user): mixed { - assert($user instanceof User); + \assert($user instanceof User); return ((int) date('Y')) - ((int) $user->age); } @@ -80,7 +67,6 @@ public function supports(string $source, string $target, string $propertyName): class UserMapperConfiguration { - } } else { class UserMapperConfiguration implements MapperConfigurationInterface diff --git a/tests/ServiceInstantiationTest.php b/tests/ServiceInstantiationTest.php index 510b211..481d069 100644 --- a/tests/ServiceInstantiationTest.php +++ b/tests/ServiceInstantiationTest.php @@ -44,7 +44,7 @@ public function testWarmup(): void self::assertInstanceOf(\Symfony_Mapper_AutoMapper_Bundle_Tests_Fixtures_AddressDTO_array::class, new \Symfony_Mapper_AutoMapper_Bundle_Tests_Fixtures_AddressDTO_array()); } - public function testAutoMapper() + public function testAutoMapper(): void { static::bootKernel(); $container = static::$kernel->getContainer();