From 1d5e16e9d9f6135fd558adef777e9da0d46a5622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Wed, 7 Dec 2016 23:32:17 +0100 Subject: [PATCH] Use short-array syntax on "tools" directory --- tools/sandbox/bootstrap.php | 8 ++++---- tools/sandbox/doctrine.php | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/sandbox/bootstrap.php b/tools/sandbox/bootstrap.php index 1e7d8ba00..410ea7f72 100644 --- a/tools/sandbox/bootstrap.php +++ b/tools/sandbox/bootstrap.php @@ -19,7 +19,7 @@ $debug = true; $config = new \Doctrine\ORM\Configuration(); // Set up Metadata Drivers -$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__ . "/Entities")); +$driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]); $config->setMetadataDriverImpl($driverImpl); // Set up caches, depending on $debug variable. @@ -33,10 +33,10 @@ $config->setProxyDir(__DIR__ . '/Proxies'); $config->setProxyNamespace('Proxies'); // Database connection information -$connectionOptions = array( +$connectionOptions = [ 'driver' => 'pdo_sqlite', 'path' => 'database.sqlite' -); +]; // Enable second-level cache $cacheConfig = new \Doctrine\ORM\Cache\CacheConfiguration(); @@ -52,4 +52,4 @@ $cacheConfig->setCacheFactory($factory); $config->setSecondLevelCacheEnabled(true); $config->setSecondLevelCacheConfiguration($cacheConfig); -return EntityManager::create($connectionOptions, $config); \ No newline at end of file +return EntityManager::create($connectionOptions, $config); diff --git a/tools/sandbox/doctrine.php b/tools/sandbox/doctrine.php index 052968690..04c99e327 100644 --- a/tools/sandbox/doctrine.php +++ b/tools/sandbox/doctrine.php @@ -5,12 +5,15 @@ $em = require_once __DIR__.'/bootstrap.php'; $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); $cli->setCatchExceptions(true); -$cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(array( - 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), - 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) -))); +$cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet( + [ + 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), + 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) + ] +)); -$cli->addCommands(array( +$cli->addCommands( + [ // DBAL Commands new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), @@ -34,5 +37,6 @@ $cli->addCommands(array( new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), -)); + ] +); $cli->run();