Skip to content

Commit ce7ef30

Browse files
committed
switched array() to []
1 parent 38042a3 commit ce7ef30

File tree

218 files changed

+2074
-2074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+2074
-2074
lines changed

CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function warmUp($cacheDir)
5454
{
5555
$arrayAdapter = new ArrayAdapter();
5656

57-
spl_autoload_register(array(PhpArrayAdapter::class, 'throwOnRequiredClass'));
57+
spl_autoload_register([PhpArrayAdapter::class, 'throwOnRequiredClass']);
5858
try {
5959
if (!$this->doWarmUp($cacheDir, $arrayAdapter)) {
6060
return;
6161
}
6262
} finally {
63-
spl_autoload_unregister(array(PhpArrayAdapter::class, 'throwOnRequiredClass'));
63+
spl_autoload_unregister([PhpArrayAdapter::class, 'throwOnRequiredClass']);
6464
}
6565

6666
// the ArrayAdapter stores the values serialized

CacheWarmer/RouterCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function isOptional()
7171
*/
7272
public static function getSubscribedServices()
7373
{
74-
return array(
74+
return [
7575
'router' => RouterInterface::class,
76-
);
76+
];
7777
}
7878
}

CacheWarmer/SerializerCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function doWarmUp($cacheDir, ArrayAdapter $arrayAdapter)
7474
*/
7575
private function extractSupportedLoaders(array $loaders)
7676
{
77-
$supportedLoaders = array();
77+
$supportedLoaders = [];
7878

7979
foreach ($loaders as $loader) {
8080
if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) {

CacheWarmer/TemplateFinder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function findAllTemplates()
5252
return $this->templates;
5353
}
5454

55-
$templates = array();
55+
$templates = [];
5656

5757
foreach ($this->kernel->getBundles() as $bundle) {
5858
$templates = array_merge($templates, $this->findTemplatesInBundle($bundle));
@@ -72,7 +72,7 @@ public function findAllTemplates()
7272
*/
7373
private function findTemplatesInFolder($dir)
7474
{
75-
$templates = array();
75+
$templates = [];
7676

7777
if (is_dir($dir)) {
7878
$finder = new Finder();

CacheWarmer/TemplatePathsCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(TemplateFinderInterface $finder, TemplateLocator $lo
3939
public function warmUp($cacheDir)
4040
{
4141
$filesystem = new Filesystem();
42-
$templates = array();
42+
$templates = [];
4343

4444
foreach ($this->finder->findAllTemplates() as $template) {
4545
$templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');

CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function isOptional()
7272
*/
7373
public static function getSubscribedServices()
7474
{
75-
return array(
75+
return [
7676
'translator' => TranslatorInterface::class,
77-
);
77+
];
7878
}
7979
}

CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array
8585
*/
8686
private function extractSupportedLoaders(array $loaders)
8787
{
88-
$supportedLoaders = array();
88+
$supportedLoaders = [];
8989

9090
foreach ($loaders as $loader) {
9191
if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) {

Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Client extends BaseClient
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function __construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
37+
public function __construct(KernelInterface $kernel, array $server = [], History $history = null, CookieJar $cookieJar = null)
3838
{
3939
parent::__construct($kernel, $server, $history, $cookieJar);
4040
}

Command/AboutCommand.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -60,46 +60,46 @@ protected function execute(InputInterface $input, OutputInterface $output)
6060
/** @var $kernel KernelInterface */
6161
$kernel = $this->getApplication()->getKernel();
6262

63-
$rows = array(
64-
array('<info>Symfony</>'),
63+
$rows = [
64+
['<info>Symfony</>'],
6565
new TableSeparator(),
66-
array('Version', Kernel::VERSION),
67-
array('End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' <error>Expired</>' : '')),
68-
array('End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' <error>Expired</>' : '')),
66+
['Version', Kernel::VERSION],
67+
['End of maintenance', Kernel::END_OF_MAINTENANCE.(self::isExpired(Kernel::END_OF_MAINTENANCE) ? ' <error>Expired</>' : '')],
68+
['End of life', Kernel::END_OF_LIFE.(self::isExpired(Kernel::END_OF_LIFE) ? ' <error>Expired</>' : '')],
6969
new TableSeparator(),
70-
array('<info>Kernel</>'),
70+
['<info>Kernel</>'],
7171
new TableSeparator(),
72-
array('Type', \get_class($kernel)),
73-
array('Name', $kernel->getName()),
74-
array('Environment', $kernel->getEnvironment()),
75-
array('Debug', $kernel->isDebug() ? 'true' : 'false'),
76-
array('Charset', $kernel->getCharset()),
77-
array('Root directory', self::formatPath($kernel->getRootDir(), $kernel->getProjectDir())),
78-
array('Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'),
79-
array('Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'),
72+
['Type', \get_class($kernel)],
73+
['Name', $kernel->getName()],
74+
['Environment', $kernel->getEnvironment()],
75+
['Debug', $kernel->isDebug() ? 'true' : 'false'],
76+
['Charset', $kernel->getCharset()],
77+
['Root directory', self::formatPath($kernel->getRootDir(), $kernel->getProjectDir())],
78+
['Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'],
79+
['Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'],
8080
new TableSeparator(),
81-
array('<info>PHP</>'),
81+
['<info>PHP</>'],
8282
new TableSeparator(),
83-
array('Version', PHP_VERSION),
84-
array('Architecture', (PHP_INT_SIZE * 8).' bits'),
85-
array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'),
86-
array('Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'),
87-
array('OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'),
88-
array('APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'),
89-
array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'),
90-
);
83+
['Version', PHP_VERSION],
84+
['Architecture', (PHP_INT_SIZE * 8).' bits'],
85+
['Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'],
86+
['Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'],
87+
['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
88+
['APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
89+
['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'],
90+
];
9191

9292
if ($dotenv = self::getDotenvVars()) {
93-
$rows = array_merge($rows, array(
93+
$rows = array_merge($rows, [
9494
new TableSeparator(),
95-
array('<info>Environment (.env)</>'),
95+
['<info>Environment (.env)</>'],
9696
new TableSeparator(),
97-
), array_map(function ($value, $name) {
98-
return array($name, $value);
97+
], array_map(function ($value, $name) {
98+
return [$name, $value];
9999
}, $dotenv, array_keys($dotenv)));
100100
}
101101

102-
$io->table(array(), $rows);
102+
$io->table([], $rows);
103103
}
104104

105105
private static function formatPath($path, $baseDir = null)
@@ -130,7 +130,7 @@ private static function isExpired($date)
130130

131131
private static function getDotenvVars()
132132
{
133-
$vars = array();
133+
$vars = [];
134134
foreach (explode(',', getenv('SYMFONY_DOTENV_VARS')) as $name) {
135135
if ('' !== $name && false !== $value = getenv($name)) {
136136
$vars[$name] = $value;

Command/AbstractConfigCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand
2929
protected function listBundles($output)
3030
{
3131
$title = 'Available registered bundles with their extension alias if available';
32-
$headers = array('Bundle name', 'Extension alias');
33-
$rows = array();
32+
$headers = ['Bundle name', 'Extension alias'];
33+
$rows = [];
3434

3535
$bundles = $this->getApplication()->getKernel()->getBundles();
3636
usort($bundles, function ($bundleA, $bundleB) {
@@ -39,7 +39,7 @@ protected function listBundles($output)
3939

4040
foreach ($bundles as $bundle) {
4141
$extension = $bundle->getContainerExtension();
42-
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
42+
$rows[] = [$bundle->getName(), $extension ? $extension->getAlias() : ''];
4343
}
4444

4545
if ($output instanceof StyleInterface) {

0 commit comments

Comments
 (0)