Skip to content

Commit 3d7aab2

Browse files
committed
fixed CS
1 parent 445fdbb commit 3d7aab2

File tree

70 files changed

+1221
-1221
lines changed

Some content is hidden

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

70 files changed

+1221
-1221
lines changed

Command/CacheClearCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public function __construct(CacheClearerInterface $cacheClearer, Filesystem $fil
5353
protected function configure()
5454
{
5555
$this
56-
->setDefinition(array(
56+
->setDefinition([
5757
new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
5858
new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
59-
))
59+
])
6060
->setDescription('Clears the cache')
6161
->setHelp(<<<'EOF'
6262
The <info>%command.name%</info> command clears the application cache for a given environment
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
137137
if ('/' === \DIRECTORY_SEPARATOR && $mounts = @file('/proc/mounts')) {
138138
foreach ($mounts as $mount) {
139139
$mount = \array_slice(explode(' ', $mount), 1, -3);
140-
if (!\in_array(array_pop($mount), array('vboxsf', 'nfs'))) {
140+
if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) {
141141
continue;
142142
}
143143
$mount = implode(' ', $mount).'/';
@@ -195,7 +195,7 @@ private function warmup(string $warmupDir, string $realCacheDir, bool $enableOpt
195195
}
196196

197197
// fix references to cached files with the real cache directory name
198-
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
198+
$search = [$warmupDir, str_replace('\\', '\\\\', $warmupDir)];
199199
$replace = str_replace('\\', '/', $realCacheDir);
200200
foreach (Finder::create()->files()->in($warmupDir) as $file) {
201201
$content = str_replace($search, $replace, file_get_contents($file), $count);

Command/CachePoolDeleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public function __construct(Psr6CacheClearer $poolClearer)
4242
protected function configure()
4343
{
4444
$this
45-
->setDefinition(array(
45+
->setDefinition([
4646
new InputArgument('pool', InputArgument::REQUIRED, 'The cache pool from which to delete an item'),
4747
new InputArgument('key', InputArgument::REQUIRED, 'The cache key to delete from the pool'),
48-
))
48+
])
4949
->setDescription('Deletes an item from a cache pool')
5050
->setHelp(<<<'EOF'
5151
The <info>%command.name%</info> deletes an item from a given cache pool.

Command/ContainerDebugCommand.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ContainerDebugCommand extends Command
4747
protected function configure()
4848
{
4949
$this
50-
->setDefinition(array(
50+
->setDefinition([
5151
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
5252
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services (deprecated)'),
5353
new InputOption('show-arguments', null, InputOption::VALUE_NONE, 'Used to show arguments in services'),
@@ -59,7 +59,7 @@ protected function configure()
5959
new InputOption('types', null, InputOption::VALUE_NONE, 'Displays types (classes/interfaces) available in the container'),
6060
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
6161
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'),
62-
))
62+
])
6363
->setDescription('Displays current services for an application')
6464
->setHelp(<<<'EOF'
6565
The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
@@ -116,26 +116,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
116116
$object = $this->getContainerBuilder();
117117

118118
if ($input->getOption('types')) {
119-
$options = array();
120-
$options['filter'] = array($this, 'filterToServiceTypes');
119+
$options = [];
120+
$options['filter'] = [$this, 'filterToServiceTypes'];
121121
} elseif ($input->getOption('parameters')) {
122-
$parameters = array();
122+
$parameters = [];
123123
foreach ($object->getParameterBag()->all() as $k => $v) {
124124
$parameters[$k] = $object->resolveEnvPlaceholders($v);
125125
}
126126
$object = new ParameterBag($parameters);
127-
$options = array();
127+
$options = [];
128128
} elseif ($parameter = $input->getOption('parameter')) {
129-
$options = array('parameter' => $parameter);
129+
$options = ['parameter' => $parameter];
130130
} elseif ($input->getOption('tags')) {
131-
$options = array('group_by' => 'tags');
131+
$options = ['group_by' => 'tags'];
132132
} elseif ($tag = $input->getOption('tag')) {
133-
$options = array('tag' => $tag);
133+
$options = ['tag' => $tag];
134134
} elseif ($name = $input->getArgument('name')) {
135135
$name = $this->findProperServiceName($input, $errorIo, $object, $name, $input->getOption('show-hidden'));
136-
$options = array('id' => $name);
136+
$options = ['id' => $name];
137137
} else {
138-
$options = array();
138+
$options = [];
139139
}
140140

141141
$helper = new DescriptorHelper();
@@ -164,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
164164
*/
165165
protected function validateInput(InputInterface $input)
166166
{
167-
$options = array('tags', 'tag', 'parameters', 'parameter');
167+
$options = ['tags', 'tag', 'parameters', 'parameter'];
168168

169169
$optionsCount = 0;
170170
foreach ($options as $option) {
@@ -199,7 +199,7 @@ protected function getContainerBuilder()
199199
if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
200200
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
201201
$container = $buildContainer();
202-
$container->getCompilerPassConfig()->setRemovingPasses(array());
202+
$container->getCompilerPassConfig()->setRemovingPasses([]);
203203
$container->compile();
204204
} else {
205205
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
@@ -227,7 +227,7 @@ private function findProperServiceName(InputInterface $input, SymfonyStyle $io,
227227
private function findServiceIdsContaining(ContainerBuilder $builder, string $name, bool $showHidden)
228228
{
229229
$serviceIds = $builder->getServiceIds();
230-
$foundServiceIds = array();
230+
$foundServiceIds = [];
231231
foreach ($serviceIds as $serviceId) {
232232
if (!$showHidden && 0 === strpos($serviceId, '.')) {
233233
continue;

Command/DebugAutowiringCommand.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class DebugAutowiringCommand extends ContainerDebugCommand
3333
protected function configure()
3434
{
3535
$this
36-
->setDefinition(array(
36+
->setDefinition([
3737
new InputArgument('search', InputArgument::OPTIONAL, 'A search filter'),
38-
))
38+
])
3939
->setDescription('Lists classes/interfaces you can use for autowiring')
4040
->setHelp(<<<'EOF'
4141
The <info>%command.name%</info> command displays all classes and interfaces that
@@ -62,7 +62,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6262

6363
$builder = $this->getContainerBuilder();
6464
$serviceIds = $builder->getServiceIds();
65-
$serviceIds = array_filter($serviceIds, array($this, 'filterToServiceTypes'));
65+
$serviceIds = array_filter($serviceIds, [$this, 'filterToServiceTypes']);
6666

6767
if ($search = $input->getArgument('search')) {
6868
$serviceIds = array_filter($serviceIds, function ($serviceId) use ($search) {
@@ -84,18 +84,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
8484
$io->text(sprintf('(only showing classes/interfaces matching <comment>%s</comment>)', $search));
8585
}
8686
$io->newLine();
87-
$tableRows = array();
88-
$hasAlias = array();
87+
$tableRows = [];
88+
$hasAlias = [];
8989
foreach ($serviceIds as $serviceId) {
9090
if ($builder->hasAlias($serviceId)) {
91-
$tableRows[] = array(sprintf('<fg=cyan>%s</fg=cyan>', $serviceId));
92-
$tableRows[] = array(sprintf(' alias to %s', $builder->getAlias($serviceId)));
91+
$tableRows[] = [sprintf('<fg=cyan>%s</fg=cyan>', $serviceId)];
92+
$tableRows[] = [sprintf(' alias to %s', $builder->getAlias($serviceId))];
9393
$hasAlias[(string) $builder->getAlias($serviceId)] = true;
9494
} else {
95-
$tableRows[$serviceId] = array(sprintf('<fg=cyan>%s</fg=cyan>', $serviceId));
95+
$tableRows[$serviceId] = [sprintf('<fg=cyan>%s</fg=cyan>', $serviceId)];
9696
}
9797
}
9898

99-
$io->table(array(), array_diff_key($tableRows, $hasAlias));
99+
$io->table([], array_diff_key($tableRows, $hasAlias));
100100
}
101101
}

Command/RouterDebugCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function __construct(RouterInterface $router)
4848
protected function configure()
4949
{
5050
$this
51-
->setDefinition(array(
51+
->setDefinition([
5252
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'),
5353
new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'),
5454
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
5555
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw route(s)'),
56-
))
56+
])
5757
->setDescription('Displays current routes for an application')
5858
->setHelp(<<<'EOF'
5959
The <info>%command.name%</info> displays the configured routes:
@@ -88,25 +88,25 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888
throw new InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
8989
}
9090

91-
$helper->describe($io, $route, array(
91+
$helper->describe($io, $route, [
9292
'format' => $input->getOption('format'),
9393
'raw_text' => $input->getOption('raw'),
9494
'name' => $name,
9595
'output' => $io,
96-
));
96+
]);
9797
} else {
98-
$helper->describe($io, $routes, array(
98+
$helper->describe($io, $routes, [
9999
'format' => $input->getOption('format'),
100100
'raw_text' => $input->getOption('raw'),
101101
'show_controllers' => $input->getOption('show-controllers'),
102102
'output' => $io,
103-
));
103+
]);
104104
}
105105
}
106106

107107
private function findRouteNameContaining(string $name, RouteCollection $routes): array
108108
{
109-
$foundRoutesNames = array();
109+
$foundRoutesNames = [];
110110
foreach ($routes as $routeName => $route) {
111111
if (false !== stripos($routeName, $name)) {
112112
$foundRoutesNames[] = $routeName;

Command/WorkflowDumpCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class WorkflowDumpCommand extends Command
3737
protected function configure()
3838
{
3939
$this
40-
->setDefinition(array(
40+
->setDefinition([
4141
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
4242
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
4343
new InputOption('label', 'l', InputOption::VALUE_REQUIRED, 'Labels a graph'),
4444
new InputOption('dump-format', null, InputOption::VALUE_REQUIRED, 'The dump format [dot|puml]', 'dot'),
45-
))
45+
])
4646
->setDescription('Dump a workflow')
4747
->setHelp(<<<'EOF'
4848
The <info>%command.name%</info> command dumps the graphical representation of a
@@ -89,13 +89,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
8989
$marking->mark($place);
9090
}
9191

92-
$options = array(
92+
$options = [
9393
'name' => $serviceId,
9494
'nofooter' => true,
95-
'graph' => array(
95+
'graph' => [
9696
'label' => $input->getOption('label'),
97-
),
98-
);
97+
],
98+
];
9999
$output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options));
100100
}
101101
}

Console/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Application extends BaseApplication
3232
{
3333
private $kernel;
3434
private $commandsRegistered = false;
35-
private $registrationErrors = array();
35+
private $registrationErrors = [];
3636

3737
public function __construct(KernelInterface $kernel)
3838
{
@@ -83,7 +83,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
8383
if (!$command instanceof ListCommand) {
8484
if ($this->registrationErrors) {
8585
$this->renderRegistrationErrors($input, $output);
86-
$this->registrationErrors = array();
86+
$this->registrationErrors = [];
8787
}
8888

8989
return parent::doRunCommand($command, $input, $output);
@@ -93,7 +93,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
9393

9494
if ($this->registrationErrors) {
9595
$this->renderRegistrationErrors($input, $output);
96-
$this->registrationErrors = array();
96+
$this->registrationErrors = [];
9797
}
9898

9999
return $returnCode;
@@ -179,7 +179,7 @@ protected function registerCommands()
179179
}
180180

181181
if ($container->hasParameter('console.command.ids')) {
182-
$lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : array();
182+
$lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : [];
183183
foreach ($container->getParameter('console.command.ids') as $id) {
184184
if (!isset($lazyCommandIds[$id])) {
185185
try {

0 commit comments

Comments
 (0)