From 8b244f4f5eaaee31309b4fbfffc572ef3a74e414 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 1 May 2011 21:30:19 +0200 Subject: [PATCH] [DoctrineBundle] fixed CS, removed some use statements --- .../Command/CreateDatabaseDoctrineCommand.php | 11 ++++------- .../Command/DropDatabaseDoctrineCommand.php | 6 +----- .../Command/GenerateEntitiesDoctrineCommand.php | 1 - .../Command/GenerateEntityDoctrineCommand.php | 2 -- .../Command/GenerateRepositoriesDoctrineCommand.php | 3 +-- .../Command/ImportMappingDoctrineCommand.php | 4 ---- .../DoctrineBundle/Command/InfoDoctrineCommand.php | 3 +-- 7 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php index 2be80fb775..bca96c64fa 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php @@ -11,13 +11,10 @@ namespace Symfony\Bundle\DoctrineBundle\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\HttpKernel\Util\Filesystem; -use Doctrine\DBAL\Connection; +use Doctrine\DBAL\DriverManager; /** * Database tool allows you to easily drop and create your configured databases. @@ -50,11 +47,11 @@ EOT $connection = $this->getDoctrineConnection($input->getOption('connection')); $params = $connection->getParams(); - $name = isset($params['path']) ? $params['path']:$params['dbname']; + $name = isset($params['path']) ? $params['path'] : $params['dbname']; unset($params['dbname']); - $tmpConnection = \Doctrine\DBAL\DriverManager::getConnection($params); + $tmpConnection = DriverManager::getConnection($params); try { $tmpConnection->getSchemaManager()->createDatabase($name); @@ -66,4 +63,4 @@ EOT $tmpConnection->close(); } -} \ No newline at end of file +} diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php index beab96a7b8..8a3d6d0455 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php @@ -11,13 +11,9 @@ namespace Symfony\Bundle\DoctrineBundle\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\HttpKernel\Util\Filesystem; -use Doctrine\DBAL\Connection; /** * Database tool allows you to easily drop and create your configured databases. @@ -78,4 +74,4 @@ EOT $output->writeln('All data will be lost!'); } } -} \ No newline at end of file +} diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php index a44b1ccf86..c49cda8065 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php @@ -15,7 +15,6 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; /** * Generate entity classes from mapping information diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php index 1a5acd8149..e96f52bc5b 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php @@ -15,9 +15,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use Doctrine\ORM\Tools\Export\ClassMetadataExporter; -use Doctrine\ORM\Tools\EntityGenerator; use Doctrine\ORM\Mapping\ClassMetadataInfo; /** diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php index 9dcc6350c5..fe395636ce 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php @@ -15,7 +15,6 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use Doctrine\ORM\Tools\EntityRepositoryGenerator; /** @@ -72,4 +71,4 @@ EOT throw new \RuntimeException(sprintf('Bundle "%s" does not contain any mapped entities.', $bundleName)); } } -} \ No newline at end of file +} diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php index 81022597e1..f75204a506 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php @@ -15,10 +15,6 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand; -use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; -use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; use Doctrine\ORM\Mapping\Driver\DatabaseDriver; use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; use Doctrine\ORM\Tools\Export\ClassMetadataExporter; diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php index 564b46c72e..949e240d3a 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php @@ -12,7 +12,6 @@ namespace Symfony\Bundle\DoctrineBundle\Command; use Doctrine\ORM\Mapping\MappingException; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -76,4 +75,4 @@ EOT } } } -} \ No newline at end of file +}