From 9a8bcf8c201d46fbb773da9e41d9f7046692a193 Mon Sep 17 00:00:00 2001 From: Olivier Dolbeau Date: Tue, 4 Jun 2019 11:08:08 +0200 Subject: [PATCH] Huge refacto to stop using paths --- .../Bundle/Command/DBALLoadCommand.php | 63 +++++++++++ .../Command/DBALSchemaCreateCommand.php | 86 --------------- .../Compiler/DBALTablePass.php | 28 +++++ .../DependencyInjection/Configuration.php | 38 ------- .../ShapinDatagenExtension.php | 6 -- .../Bundle/Resources/config/services.xml | 9 +- .../Symfony/Bundle/ShapinDatagenBundle.php | 8 ++ src/DBAL/Loader.php | 80 ++++++++++++++ src/DBAL/Loader/FixtureLoader.php | 93 ---------------- src/DBAL/Loader/SchemaLoader.php | 101 ------------------ tests/Bridge/Symfony/Bundle/CommandsTest.php | 2 +- .../DependencyInjection/ConfigurationTest.php | 23 ---- tests/DBAL/Loader/FixtureLoaderTest.php | 37 ------- tests/DBAL/Loader/SchemaLoaderTest.php | 30 ------ tests/DBAL/LoaderTest.php | 61 +++++++++++ .../TestBundle/Datagen/DBAL/Table1.php | 2 +- .../TestBundle/Datagen/DBAL/Table2.php | 2 +- .../TestBundle/Datagen/DBAL/Table3.php | 2 +- .../TestBundle/Datagen/DBAL/Table4.php | 2 +- .../TestBundle/Datagen/DBAL/Table5.php | 2 +- .../TestBundle/Datagen/DBAL/Table6.php | 2 +- 21 files changed, 251 insertions(+), 426 deletions(-) create mode 100644 src/Bridge/Symfony/Bundle/Command/DBALLoadCommand.php delete mode 100644 src/Bridge/Symfony/Bundle/Command/DBALSchemaCreateCommand.php create mode 100644 src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DBALTablePass.php delete mode 100644 src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php create mode 100644 src/DBAL/Loader.php delete mode 100644 src/DBAL/Loader/FixtureLoader.php delete mode 100644 src/DBAL/Loader/SchemaLoader.php delete mode 100644 tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php delete mode 100644 tests/DBAL/Loader/FixtureLoaderTest.php delete mode 100644 tests/DBAL/Loader/SchemaLoaderTest.php create mode 100644 tests/DBAL/LoaderTest.php diff --git a/src/Bridge/Symfony/Bundle/Command/DBALLoadCommand.php b/src/Bridge/Symfony/Bundle/Command/DBALLoadCommand.php new file mode 100644 index 0000000..a4cdfe8 --- /dev/null +++ b/src/Bridge/Symfony/Bundle/Command/DBALLoadCommand.php @@ -0,0 +1,63 @@ +connection = $connection; + $this->loader = $loader; + + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('shapin:datagen:dbal:load') + ->setDescription('Load the DBAL schema.') + ->addOption('groups', 'g', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Which groups should be loaded? (default: all)') + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $io = new SymfonyStyle($input, $output); + $io->title('Create database schema with DBAL.'); + + $groups = $input->getOption('groups', []); + + $statements = $this->loader->getSchema($groups)->toSql($this->connection->getDatabasePlatform()); + foreach ($statements as $statement) { + $this->connection->query($statement); + } + + $io->success('Schema created successfully.'); + + foreach ($this->loader->getFixtures($groups) as $fixture) { + $this->connection->insert($fixture[0], $fixture[1], $fixture[2]); + } + + $io->success('Fixtures created successfully.'); + } +} diff --git a/src/Bridge/Symfony/Bundle/Command/DBALSchemaCreateCommand.php b/src/Bridge/Symfony/Bundle/Command/DBALSchemaCreateCommand.php deleted file mode 100644 index 0944ede..0000000 --- a/src/Bridge/Symfony/Bundle/Command/DBALSchemaCreateCommand.php +++ /dev/null @@ -1,86 +0,0 @@ -connection = $connection; - $this->fixtureLoader = $fixtureLoader; - $this->groups = $groups; - - parent::__construct(); - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('datagen:dbal:schema:create') - ->setDescription('Create the DBAL schema.') - ->addOption('groups', 'g', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Which groups should be loaded? (default: all)') - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $io->title('Create database schema with DBAL.'); - - $groups = $this->groups; - if ([] !== $wantedGroups = $input->getOption('groups')) { - $groups = []; - foreach ($wantedGroups as $wantedGroup) { - if (!array_key_exists($wantedGroup, $this->groups)) { - throw new \InvalidArgumentException(sprintf('Unknown group "%s". Available: ["%s"]', $wantedGroup, implode('", "', array_keys($this->groups)))); - } - - $groups[$wantedGroup] = $this->groups[$wantedGroup]; - } - } - - $schemaLoader = new SchemaLoader(new Schema()); - foreach ($groups as $path) { - $schemaLoader->load($path); - } - - $statements = $schemaLoader->getSchema()->toSql($this->connection->getDatabasePlatform()); - foreach ($statements as $statement) { - $this->connection->query($statement); - } - - $io->success('Schema created successfully.'); - - foreach ($groups as $path) { - $this->fixtureLoader->load($path); - } - - foreach ($this->fixtureLoader->getFixtures() as $fixture) { - $this->connection->insert($fixture[0], $fixture[1], $fixture[2]); - } - - $io->success('Fixtures created successfully.'); - } -} diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DBALTablePass.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DBALTablePass.php new file mode 100644 index 0000000..9bc1f35 --- /dev/null +++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DBALTablePass.php @@ -0,0 +1,28 @@ +getDefinition(Loader::class); + + foreach ($container->findTaggedServiceIds('shapin_datagen.dbal_table') as $id => $tags) { + $groups = []; + foreach ($tags as $attributes) { + if (isset($attributes['group'])) { + $groups[] = $attributes['group']; + } + } + $loader->addMethodCall('addTable', [new Reference($id), $groups]); + } + } +} diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php deleted file mode 100644 index 785b7a3..0000000 --- a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,38 +0,0 @@ -getRootNode(); - } else { - // BC layer for symfony/config 4.1 and older - $rootNode = $treeBuilder->root('datagen'); - } - - $rootNode - ->children() - ->arrayNode('groups') - ->isRequired() - ->requiresAtLeastOneElement() - ->scalarPrototype()->end() - ->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/ShapinDatagenExtension.php b/src/Bridge/Symfony/Bundle/DependencyInjection/ShapinDatagenExtension.php index 755380d..51301a2 100644 --- a/src/Bridge/Symfony/Bundle/DependencyInjection/ShapinDatagenExtension.php +++ b/src/Bridge/Symfony/Bundle/DependencyInjection/ShapinDatagenExtension.php @@ -16,13 +16,7 @@ final class ShapinDatagenExtension extends Extension */ public function load(array $configs, ContainerBuilder $container) { - $configuration = new Configuration(); - $config = $this->processConfiguration($configuration, $configs); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); - - $definition = $container->getDefinition('shapin.datagen.command.dbal_schema_create'); - $definition->replaceArgument(2, $config['groups']); } } diff --git a/src/Bridge/Symfony/Bundle/Resources/config/services.xml b/src/Bridge/Symfony/Bundle/Resources/config/services.xml index ab220f1..9a70376 100644 --- a/src/Bridge/Symfony/Bundle/Resources/config/services.xml +++ b/src/Bridge/Symfony/Bundle/Resources/config/services.xml @@ -6,15 +6,14 @@ - + + + - - + - - diff --git a/src/Bridge/Symfony/Bundle/ShapinDatagenBundle.php b/src/Bridge/Symfony/Bundle/ShapinDatagenBundle.php index 7d38d96..a1ca878 100644 --- a/src/Bridge/Symfony/Bundle/ShapinDatagenBundle.php +++ b/src/Bridge/Symfony/Bundle/ShapinDatagenBundle.php @@ -4,8 +4,16 @@ namespace Shapin\Datagen\Bridge\Symfony\Bundle; +use Shapin\Datagen\Bridge\Symfony\Bundle\DependencyInjection\Compiler\DBALTablePass; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; final class ShapinDatagenBundle extends Bundle { + public function build(ContainerBuilder $container) + { + parent::build($container); + + $container->addCompilerPass(new DBALTablePass()); + } } diff --git a/src/DBAL/Loader.php b/src/DBAL/Loader.php new file mode 100644 index 0000000..67f63f2 --- /dev/null +++ b/src/DBAL/Loader.php @@ -0,0 +1,80 @@ +tables[$table->getTableName()] = $table; + + foreach ($groups as $group) { + if (!isset($this->groups[$group])) { + $this->groups[$group] = []; + } + $this->groups[$group][] = $table->getTableName(); + } + } + + public function getSchema(array $groups = []): Schema + { + $schema = new Schema(); + + foreach ($this->getTables() as $table) { + $table->addTableToSchema($schema); + } + + return $schema; + } + + public function getFixtures(array $groups = []): iterable + { + foreach ($this->getTables($groups) as $table) { + $tableName = $table->getTableName(); + $types = $table->getTypes(); + + foreach ($table->getRows() as $row) { + yield [$tableName, $row, $types]; + } + } + } + + private function getTables(array $groups = []): array + { + // Check that all groups exists. + foreach ($groups as $groups) { + if (!isset($this->groups[$group])) { + throw new \InvalidArgumentException(sprintf('Unknown group %s. Available: [%s]', $group, implode(', ', array_keys($this->groups)))); + } + } + + if (0 === count($groups)) { + $tables = $this->tables; + } else { + $tables = []; + foreach ($groups as $group) { + foreach ($this->groups[$group] as $tableInGroup) { + $tables[] = $this->tables[$tableInGroup]; + } + } + } + + // Order all tables + usort($tables, function ($a, $b) { + if ($a->getOrder() === $b->getOrder()) { + return 0; + } + + return $a->getOrder() < $b->getOrder() ? -1 : 1; + }); + + return $tables; + } +} diff --git a/src/DBAL/Loader/FixtureLoader.php b/src/DBAL/Loader/FixtureLoader.php deleted file mode 100644 index 1793400..0000000 --- a/src/DBAL/Loader/FixtureLoader.php +++ /dev/null @@ -1,93 +0,0 @@ -getBasename('.php') === $file->getBasename()) { - continue; - } - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - - $declared = get_declared_classes(); - // Make the declared classes order deterministic - sort($declared); - - $fixtures = []; - foreach ($declared as $className) { - $reflClass = new \ReflectionClass($className); - $sourceFile = $reflClass->getFileName(); - - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - if (!isset($fixtures[$className])) { - $fixtures[$className] = new $className(); - } - } - } - - usort($fixtures, function ($a, $b) { - if ($a->getOrder() === $b->getOrder()) { - return 0; - } - - return $a->getOrder() < $b->getOrder() ? -1 : 1; - }); - - foreach ($fixtures as $fixture) { - $tableName = $fixture->getTableName(); - $types = $fixture->getTypes(); - - foreach ($fixture->getRows() as $row) { - $this->fixtures[] = [$tableName, $row, $types]; - } - } - } - - public function getFixtures(): array - { - return $this->fixtures; - } - - /** - * Check if a given class is transient and should not be considered a - * class. - * - * @return bool - */ - protected function isTransient($className) - { - $rc = new \ReflectionClass($className); - if ($rc->isAbstract()) { - return true; - } - - return !$rc->implementsInterface(TableInterface::class); - } -} diff --git a/src/DBAL/Loader/SchemaLoader.php b/src/DBAL/Loader/SchemaLoader.php deleted file mode 100644 index 83daa3b..0000000 --- a/src/DBAL/Loader/SchemaLoader.php +++ /dev/null @@ -1,101 +0,0 @@ -schema = $schema; - } - - public function load($path) - { - if (is_dir($path)) { - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - } elseif (is_file($path)) { - $iterator = new \ArrayIterator([new \SplFileInfo($path)]); - } else { - return; - } - - $includedFiles = []; - foreach ($iterator as $file) { - if ($file->getBasename($this->fileExtension) == $file->getBasename()) { - continue; - } - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - - $declared = get_declared_classes(); - // Make the declared classes order deterministic - sort($declared); - - $tables = []; - foreach ($declared as $className) { - $reflClass = new \ReflectionClass($className); - $sourceFile = $reflClass->getFileName(); - - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - if (!isset($tables[$className])) { - $tables[$className] = new $className(); - } - } - } - - usort($tables, function ($a, $b) { - if ($a->getOrder() === $b->getOrder()) { - return 0; - } - - return $a->getOrder() < $b->getOrder() ? -1 : 1; - }); - - foreach ($tables as $table) { - $table->addTableToSchema($this->schema); - } - } - - public function getSchema(): Schema - { - return $this->schema; - } - - /** - * Check if a given class is transient and should not be considered a - * class. - * - * @return bool - */ - protected function isTransient($className) - { - $rc = new \ReflectionClass($className); - if ($rc->isAbstract()) { - return true; - } - - return !$rc->implementsInterface(TableInterface::class); - } -} diff --git a/tests/Bridge/Symfony/Bundle/CommandsTest.php b/tests/Bridge/Symfony/Bundle/CommandsTest.php index d0cb10a..9c36fd8 100644 --- a/tests/Bridge/Symfony/Bundle/CommandsTest.php +++ b/tests/Bridge/Symfony/Bundle/CommandsTest.php @@ -20,7 +20,7 @@ public function testExecute() $tester = new ApplicationTester($application); - $tester->run(['command' => 'datagen:dbal:schema:create']); + $tester->run(['command' => 'shapin:datagen:dbal:load']); $this->assertSame(0, $tester->getStatusCode()); $this->assertContains('[OK] Schema created successfully.', $tester->getDisplay()); $this->assertContains('[OK] Fixtures created successfully.', $tester->getDisplay()); diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php deleted file mode 100644 index 000614c..0000000 --- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php +++ /dev/null @@ -1,23 +0,0 @@ -processConfiguration(new Configuration(), [$config['shapin_datagen']]); - - $this->assertTrue(is_array($processedConfig)); - } -} diff --git a/tests/DBAL/Loader/FixtureLoaderTest.php b/tests/DBAL/Loader/FixtureLoaderTest.php deleted file mode 100644 index 6cedee9..0000000 --- a/tests/DBAL/Loader/FixtureLoaderTest.php +++ /dev/null @@ -1,37 +0,0 @@ -load(__DIR__.'/../../Fixtures/TestBundle/Datagen/DBAL'); - - $fixtures = $fixtureLoader->getFixtures(); - $this->assertCount(9, $fixtures); - - $date = new \Datetime('@0'); - - $expectedFixtures = [ - ['table1', ['uuid' => 'uuid1_1', 'created_at' => $date], ['created_at' => 'datetimetz']], - ['table1', ['uuid' => 'uuid1_2', 'created_at' => $date], ['created_at' => 'datetimetz']], - ['table1', ['uuid' => 'uuid1_3', 'created_at' => $date], ['created_at' => 'datetimetz']], - ['table2', ['uuid' => 'uuid2_1'], []], - ['table2', ['uuid' => 'uuid2_2'], []], - ['table2', ['uuid' => 'uuid2_3'], []], - ['table3', ['uuid' => 'uuid3_1', 'field3' => 'another_field'], []], - ['table3', ['uuid' => 'uuid3_2', 'field3' => 'another_field'], []], - ['table3', ['uuid' => 'uuid3_3', 'field3' => 'another_field'], []], - ]; - - $this->assertEquals($expectedFixtures, $fixtures); - } -} diff --git a/tests/DBAL/Loader/SchemaLoaderTest.php b/tests/DBAL/Loader/SchemaLoaderTest.php deleted file mode 100644 index a2099a5..0000000 --- a/tests/DBAL/Loader/SchemaLoaderTest.php +++ /dev/null @@ -1,30 +0,0 @@ -load(__DIR__.'/../../Fixtures/TestBundle/Datagen/DBAL'); - - $tables = $schemaLoader->getSchema()->getTables(); - - $this->assertCount(6, $tables); - - $tableNames = []; - array_walk($tables, function ($item, $key) use (&$tableNames) { - $tableNames[] = $item->getName(); - }); - - $this->assertEquals(['table1', 'table2', 'table3', 'table6', 'table4', 'table5'], $tableNames); - } -} diff --git a/tests/DBAL/LoaderTest.php b/tests/DBAL/LoaderTest.php new file mode 100644 index 0000000..c407afa --- /dev/null +++ b/tests/DBAL/LoaderTest.php @@ -0,0 +1,61 @@ +getLoader()->getSchema()->getTables(); + + $this->assertCount(6, $tables); + + $tableNames = []; + array_walk($tables, function ($item, $key) use (&$tableNames) { + $tableNames[] = $item->getName(); + }); + + $this->assertEquals(['table1', 'table2', 'table3', 'table6', 'table4', 'table5'], $tableNames); + } + + public function test_getFixtures() + { + $fixtures = iterator_to_array($this->getLoader()->getFixtures()); + $this->assertCount(9, $fixtures); + + $date = new \Datetime('@0'); + + $expectedFixtures = [ + ['table1', ['uuid' => 'uuid1_1', 'created_at' => $date], ['created_at' => 'datetimetz']], + ['table1', ['uuid' => 'uuid1_2', 'created_at' => $date], ['created_at' => 'datetimetz']], + ['table1', ['uuid' => 'uuid1_3', 'created_at' => $date], ['created_at' => 'datetimetz']], + ['table2', ['uuid' => 'uuid2_1'], []], + ['table2', ['uuid' => 'uuid2_2'], []], + ['table2', ['uuid' => 'uuid2_3'], []], + ['table3', ['uuid' => 'uuid3_1', 'field3' => 'another_field'], []], + ['table3', ['uuid' => 'uuid3_2', 'field3' => 'another_field'], []], + ['table3', ['uuid' => 'uuid3_3', 'field3' => 'another_field'], []], + ]; + + $this->assertEquals($expectedFixtures, $fixtures); + } + + private function getLoader() + { + $loader = new Loader(); + $loader->addTable(new Table\Table1()); + $loader->addTable(new Table\Table2()); + $loader->addTable(new Table\Table3()); + $loader->addTable(new Table\Table4()); + $loader->addTable(new Table\Table5()); + $loader->addTable(new Table\Table6()); + + return $loader; + } +} diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table1.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table1.php index 099033d..bf2a3e0 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table1.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table1.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table2.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table2.php index 6cad385..80c6207 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table2.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table2.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table3.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table3.php index 4aab37c..10a7154 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table3.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table3.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table4.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table4.php index e90950e..ec92ba1 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table4.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table4.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table5.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table5.php index c9075fe..db9de32 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table5.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table5.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/Fixtures/TestBundle/Datagen/DBAL/Table6.php b/tests/Fixtures/TestBundle/Datagen/DBAL/Table6.php index 241b571..644946a 100644 --- a/tests/Fixtures/TestBundle/Datagen/DBAL/Table6.php +++ b/tests/Fixtures/TestBundle/Datagen/DBAL/Table6.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL\Table; +namespace Shapin\Datagen\Tests\Fixtures\TestBundle\Datagen\DBAL; use Shapin\Datagen\DBAL\Table; use Doctrine\DBAL\Schema\Schema;