From a45d63125016681c21782a4a1ae30d0b600db5c5 Mon Sep 17 00:00:00 2001 From: nikophil Date: Fri, 24 Nov 2023 06:57:54 +0000 Subject: [PATCH] bot: fix cs [skip ci] --- src/Bundle/DependencyInjection/Configuration.php | 4 ++-- .../DependencyInjection/ZenstruckFoundryExtension.php | 6 ++---- .../DependencyInjection/ZenstruckFoundryExtensionTest.php | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Bundle/DependencyInjection/Configuration.php b/src/Bundle/DependencyInjection/Configuration.php index 8e56f4392..6436e5c2c 100644 --- a/src/Bundle/DependencyInjection/Configuration.php +++ b/src/Bundle/DependencyInjection/Configuration.php @@ -96,7 +96,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->arrayNode('orm') // could be activated in 2.0 - //->addDefaultsIfNotSet() + // ->addDefaultsIfNotSet() ->children() ->arrayNode('reset') ->addDefaultsIfNotSet() @@ -122,7 +122,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->arrayNode('mongo') // could be activated in 2.0 - //->addDefaultsIfNotSet() + // ->addDefaultsIfNotSet() ->children() ->arrayNode('reset') ->addDefaultsIfNotSet() diff --git a/src/Bundle/DependencyInjection/ZenstruckFoundryExtension.php b/src/Bundle/DependencyInjection/ZenstruckFoundryExtension.php index 536ccd2ce..923ed9597 100644 --- a/src/Bundle/DependencyInjection/ZenstruckFoundryExtension.php +++ b/src/Bundle/DependencyInjection/ZenstruckFoundryExtension.php @@ -24,8 +24,6 @@ use Zenstruck\Foundry\Bundle\Command\StubMakeStory; use Zenstruck\Foundry\Instantiator; use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory; -use Zenstruck\Foundry\Persistence\Proxy as ProxyBase; -use Zenstruck\Foundry\Proxy; use Zenstruck\Foundry\Story; use Zenstruck\Foundry\Test\ORMDatabaseResetter; use Zenstruck\Foundry\Test\ResetDatabase; @@ -110,7 +108,7 @@ private function configureDatabaseResetter(array $config, ContainerBuilder $cont $legacyConfig = $config['database_resetter']; if (false === $legacyConfig['enabled']) { - trigger_deprecation('zenstruck\foundry', '1.37.0', sprintf('Disabling database reset via bundle configuration is deprecated and will be removed in 2.0. Instead you should not use "%s" trait in your test.', ResetDatabase::class)); + trigger_deprecation('zenstruck\foundry', '1.37.0', \sprintf('Disabling database reset via bundle configuration is deprecated and will be removed in 2.0. Instead you should not use "%s" trait in your test.', ResetDatabase::class)); $configurationDefinition->addMethodCall('disableDatabaseReset'); } @@ -127,7 +125,7 @@ private function configureDatabaseResetter(array $config, ContainerBuilder $cont throw new \InvalidArgumentException('Configurations "zenstruck_foundry.mongo.reset" and "zenstruck_foundry.database_resetter.odm" are incompatible. You should only use "zenstruck_foundry.mongo.reset".'); } - if ((isset($legacyConfig['odm']) || isset($config['mongo']['reset'])) && !self::isBundleLoaded($container, DoctrineMongoDBBundle::class)) { + if ((isset($legacyConfig['odm']) || isset($config['mongo']['reset'])) && !self::isBundleLoaded($container, DoctrineMongoDBBundle::class)) { throw new \InvalidArgumentException('doctrine/mongodb-odm-bundle should be enabled to use config under "mongo.reset".'); } diff --git a/tests/Unit/Bundle/DependencyInjection/ZenstruckFoundryExtensionTest.php b/tests/Unit/Bundle/DependencyInjection/ZenstruckFoundryExtensionTest.php index 32d57aa78..2c855611c 100644 --- a/tests/Unit/Bundle/DependencyInjection/ZenstruckFoundryExtensionTest.php +++ b/tests/Unit/Bundle/DependencyInjection/ZenstruckFoundryExtensionTest.php @@ -232,7 +232,7 @@ public function it_registers_makers_if_maker_bundle_enabled(): void public function cannot_configure_legacy_database_resetter_if_doctrine_not_enabled(string $doctrine): void { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage(\sprintf('should be enabled to use config under "%s.reset"', $doctrine === 'orm' ? 'orm' : 'mongo')); + $this->expectExceptionMessage(\sprintf('should be enabled to use config under "%s.reset"', 'orm' === $doctrine ? 'orm' : 'mongo')); $this->load(['database_resetter' => [$doctrine => []]]); }