Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil authored and kbond committed Nov 24, 2023
1 parent e10865e commit a45d631
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->arrayNode('orm')
// could be activated in 2.0
//->addDefaultsIfNotSet()
// ->addDefaultsIfNotSet()
->children()
->arrayNode('reset')
->addDefaultsIfNotSet()
Expand All @@ -122,7 +122,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->arrayNode('mongo')
// could be activated in 2.0
//->addDefaultsIfNotSet()
// ->addDefaultsIfNotSet()
->children()
->arrayNode('reset')
->addDefaultsIfNotSet()
Expand Down
6 changes: 2 additions & 4 deletions src/Bundle/DependencyInjection/ZenstruckFoundryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
Expand All @@ -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".');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => []]]);
}
Expand Down

0 comments on commit a45d631

Please sign in to comment.