Skip to content

Commit 445fdbb

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents d0a7229 + 4401fe8 commit 445fdbb

File tree

186 files changed

+933
-933
lines changed

Some content is hidden

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

186 files changed

+933
-933
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
@@ -67,8 +67,8 @@ public function isOptional()
6767
*/
6868
public static function getSubscribedServices()
6969
{
70-
return array(
70+
return [
7171
'router' => RouterInterface::class,
72-
);
72+
];
7373
}
7474
}

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
@@ -60,8 +60,8 @@ public function isOptional()
6060
*/
6161
public static function getSubscribedServices()
6262
{
63-
return array(
63+
return [
6464
'translator' => TranslatorInterface::class,
65-
);
65+
];
6666
}
6767
}

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
@@ -61,46 +61,46 @@ protected function execute(InputInterface $input, OutputInterface $output)
6161
/** @var $kernel KernelInterface */
6262
$kernel = $this->getApplication()->getKernel();
6363

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

9393
if ($dotenv = self::getDotenvVars()) {
94-
$rows = array_merge($rows, array(
94+
$rows = array_merge($rows, [
9595
new TableSeparator(),
96-
array('<info>Environment (.env)</>'),
96+
['<info>Environment (.env)</>'],
9797
new TableSeparator(),
98-
), array_map(function ($value, $name) {
99-
return array($name, $value);
98+
], array_map(function ($value, $name) {
99+
return [$name, $value];
100100
}, $dotenv, array_keys($dotenv)));
101101
}
102102

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

106106
private static function formatPath(string $path, string $baseDir = null): string
@@ -131,7 +131,7 @@ private static function isExpired(string $date): bool
131131

132132
private static function getDotenvVars(): array
133133
{
134-
$vars = array();
134+
$vars = [];
135135
foreach (explode(',', getenv('SYMFONY_DOTENV_VARS')) as $name) {
136136
if ('' !== $name && false !== $value = getenv($name)) {
137137
$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)