Skip to content

Commit 68001d4

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 b28d294 + be900b1 commit 68001d4

File tree

81 files changed

+844
-844
lines changed

Some content is hidden

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

81 files changed

+844
-844
lines changed

Command/Command.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Command
3737
private $application;
3838
private $name;
3939
private $processTitle;
40-
private $aliases = array();
40+
private $aliases = [];
4141
private $definition;
4242
private $hidden = false;
4343
private $help;
@@ -46,8 +46,8 @@ class Command
4646
private $applicationDefinitionMerged = false;
4747
private $applicationDefinitionMergedWithArgs = false;
4848
private $code;
49-
private $synopsis = array();
50-
private $usages = array();
49+
private $synopsis = [];
50+
private $usages = [];
5151
private $helperSet;
5252

5353
/**
@@ -527,14 +527,14 @@ public function getProcessedHelp()
527527
$name = $this->name;
528528
$isSingleCommand = $this->application && $this->application->isSingleCommand();
529529

530-
$placeholders = array(
530+
$placeholders = [
531531
'%command.name%',
532532
'%command.full_name%',
533-
);
534-
$replacements = array(
533+
];
534+
$replacements = [
535535
$name,
536536
$isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,
537-
);
537+
];
538538

539539
return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
540540
}

Command/HelpCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ protected function configure()
3535

3636
$this
3737
->setName('help')
38-
->setDefinition(array(
38+
->setDefinition([
3939
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
4040
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
4141
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
42-
))
42+
])
4343
->setDescription('Displays help for a command')
4444
->setHelp(<<<'EOF'
4545
The <info>%command.name%</info> command displays help for a given command:
@@ -71,10 +71,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
}
7272

7373
$helper = new DescriptorHelper();
74-
$helper->describe($output, $this->command, array(
74+
$helper->describe($output, $this->command, [
7575
'format' => $input->getOption('format'),
7676
'raw_text' => $input->getOption('raw'),
77-
));
77+
]);
7878

7979
$this->command = null;
8080
}

Command/ListCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ public function getNativeDefinition()
6969
protected function execute(InputInterface $input, OutputInterface $output)
7070
{
7171
$helper = new DescriptorHelper();
72-
$helper->describe($output, $this->getApplication(), array(
72+
$helper->describe($output, $this->getApplication(), [
7373
'format' => $input->getOption('format'),
7474
'raw_text' => $input->getOption('raw'),
7575
'namespace' => $input->getArgument('namespace'),
76-
));
76+
]);
7777
}
7878

7979
/**
8080
* {@inheritdoc}
8181
*/
8282
private function createDefinition()
8383
{
84-
return new InputDefinition(array(
84+
return new InputDefinition([
8585
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
8686
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
8787
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
88-
));
88+
]);
8989
}
9090
}

Descriptor/ApplicationDescription.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ public function getCommand($name)
9292

9393
private function inspectApplication()
9494
{
95-
$this->commands = array();
96-
$this->namespaces = array();
95+
$this->commands = [];
96+
$this->namespaces = [];
9797

9898
$all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null);
9999
foreach ($this->sortCommands($all) as $namespace => $commands) {
100-
$names = array();
100+
$names = [];
101101

102102
/** @var Command $command */
103103
foreach ($commands as $name => $command) {
@@ -114,14 +114,14 @@ private function inspectApplication()
114114
$names[] = $name;
115115
}
116116

117-
$this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names);
117+
$this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names];
118118
}
119119
}
120120

121121
private function sortCommands(array $commands): array
122122
{
123-
$namespacedCommands = array();
124-
$globalCommands = array();
123+
$namespacedCommands = [];
124+
$globalCommands = [];
125125
foreach ($commands as $name => $command) {
126126
$key = $this->application->extractNamespace($name, 1);
127127
if (!$key) {

Descriptor/Descriptor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class Descriptor implements DescriptorInterface
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function describe(OutputInterface $output, $object, array $options = array())
37+
public function describe(OutputInterface $output, $object, array $options = [])
3838
{
3939
$this->output = $output;
4040

@@ -75,33 +75,33 @@ protected function write($content, $decorated = false)
7575
*
7676
* @return string|mixed
7777
*/
78-
abstract protected function describeInputArgument(InputArgument $argument, array $options = array());
78+
abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
7979

8080
/**
8181
* Describes an InputOption instance.
8282
*
8383
* @return string|mixed
8484
*/
85-
abstract protected function describeInputOption(InputOption $option, array $options = array());
85+
abstract protected function describeInputOption(InputOption $option, array $options = []);
8686

8787
/**
8888
* Describes an InputDefinition instance.
8989
*
9090
* @return string|mixed
9191
*/
92-
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());
92+
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
9393

9494
/**
9595
* Describes a Command instance.
9696
*
9797
* @return string|mixed
9898
*/
99-
abstract protected function describeCommand(Command $command, array $options = array());
99+
abstract protected function describeCommand(Command $command, array $options = []);
100100

101101
/**
102102
* Describes an Application instance.
103103
*
104104
* @return string|mixed
105105
*/
106-
abstract protected function describeApplication(Application $application, array $options = array());
106+
abstract protected function describeApplication(Application $application, array $options = []);
107107
}

Descriptor/DescriptorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ interface DescriptorInterface
2727
* @param object $object
2828
* @param array $options
2929
*/
30-
public function describe(OutputInterface $output, $object, array $options = array());
30+
public function describe(OutputInterface $output, $object, array $options = []);
3131
}

Descriptor/JsonDescriptor.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,49 +29,49 @@ class JsonDescriptor extends Descriptor
2929
/**
3030
* {@inheritdoc}
3131
*/
32-
protected function describeInputArgument(InputArgument $argument, array $options = array())
32+
protected function describeInputArgument(InputArgument $argument, array $options = [])
3333
{
3434
$this->writeData($this->getInputArgumentData($argument), $options);
3535
}
3636

3737
/**
3838
* {@inheritdoc}
3939
*/
40-
protected function describeInputOption(InputOption $option, array $options = array())
40+
protected function describeInputOption(InputOption $option, array $options = [])
4141
{
4242
$this->writeData($this->getInputOptionData($option), $options);
4343
}
4444

4545
/**
4646
* {@inheritdoc}
4747
*/
48-
protected function describeInputDefinition(InputDefinition $definition, array $options = array())
48+
protected function describeInputDefinition(InputDefinition $definition, array $options = [])
4949
{
5050
$this->writeData($this->getInputDefinitionData($definition), $options);
5151
}
5252

5353
/**
5454
* {@inheritdoc}
5555
*/
56-
protected function describeCommand(Command $command, array $options = array())
56+
protected function describeCommand(Command $command, array $options = [])
5757
{
5858
$this->writeData($this->getCommandData($command), $options);
5959
}
6060

6161
/**
6262
* {@inheritdoc}
6363
*/
64-
protected function describeApplication(Application $application, array $options = array())
64+
protected function describeApplication(Application $application, array $options = [])
6565
{
6666
$describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
6767
$description = new ApplicationDescription($application, $describedNamespace, true);
68-
$commands = array();
68+
$commands = [];
6969

7070
foreach ($description->getCommands() as $command) {
7171
$commands[] = $this->getCommandData($command);
7272
}
7373

74-
$data = array();
74+
$data = [];
7575
if ('UNKNOWN' !== $application->getName()) {
7676
$data['application']['name'] = $application->getName();
7777
if ('UNKNOWN' !== $application->getVersion()) {
@@ -105,47 +105,47 @@ private function writeData(array $data, array $options)
105105
*/
106106
private function getInputArgumentData(InputArgument $argument)
107107
{
108-
return array(
108+
return [
109109
'name' => $argument->getName(),
110110
'is_required' => $argument->isRequired(),
111111
'is_array' => $argument->isArray(),
112112
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
113113
'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(),
114-
);
114+
];
115115
}
116116

117117
/**
118118
* @return array
119119
*/
120120
private function getInputOptionData(InputOption $option)
121121
{
122-
return array(
122+
return [
123123
'name' => '--'.$option->getName(),
124124
'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '',
125125
'accept_value' => $option->acceptValue(),
126126
'is_value_required' => $option->isValueRequired(),
127127
'is_multiple' => $option->isArray(),
128128
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
129129
'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(),
130-
);
130+
];
131131
}
132132

133133
/**
134134
* @return array
135135
*/
136136
private function getInputDefinitionData(InputDefinition $definition)
137137
{
138-
$inputArguments = array();
138+
$inputArguments = [];
139139
foreach ($definition->getArguments() as $name => $argument) {
140140
$inputArguments[$name] = $this->getInputArgumentData($argument);
141141
}
142142

143-
$inputOptions = array();
143+
$inputOptions = [];
144144
foreach ($definition->getOptions() as $name => $option) {
145145
$inputOptions[$name] = $this->getInputOptionData($option);
146146
}
147147

148-
return array('arguments' => $inputArguments, 'options' => $inputOptions);
148+
return ['arguments' => $inputArguments, 'options' => $inputOptions];
149149
}
150150

151151
/**
@@ -156,13 +156,13 @@ private function getCommandData(Command $command)
156156
$command->getSynopsis();
157157
$command->mergeApplicationDefinition(false);
158158

159-
return array(
159+
return [
160160
'name' => $command->getName(),
161-
'usage' => array_merge(array($command->getSynopsis()), $command->getUsages(), $command->getAliases()),
161+
'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()),
162162
'description' => $command->getDescription(),
163163
'help' => $command->getProcessedHelp(),
164164
'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
165165
'hidden' => $command->isHidden(),
166-
);
166+
];
167167
}
168168
}

Descriptor/MarkdownDescriptor.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MarkdownDescriptor extends Descriptor
3131
/**
3232
* {@inheritdoc}
3333
*/
34-
public function describe(OutputInterface $output, $object, array $options = array())
34+
public function describe(OutputInterface $output, $object, array $options = [])
3535
{
3636
$decorated = $output->isDecorated();
3737
$output->setDecorated(false);
@@ -52,7 +52,7 @@ protected function write($content, $decorated = true)
5252
/**
5353
* {@inheritdoc}
5454
*/
55-
protected function describeInputArgument(InputArgument $argument, array $options = array())
55+
protected function describeInputArgument(InputArgument $argument, array $options = [])
5656
{
5757
$this->write(
5858
'#### `'.($argument->getName() ?: '<none>')."`\n\n"
@@ -66,7 +66,7 @@ protected function describeInputArgument(InputArgument $argument, array $options
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
protected function describeInputOption(InputOption $option, array $options = array())
69+
protected function describeInputOption(InputOption $option, array $options = [])
7070
{
7171
$name = '--'.$option->getName();
7272
if ($option->getShortcut()) {
@@ -86,7 +86,7 @@ protected function describeInputOption(InputOption $option, array $options = arr
8686
/**
8787
* {@inheritdoc}
8888
*/
89-
protected function describeInputDefinition(InputDefinition $definition, array $options = array())
89+
protected function describeInputDefinition(InputDefinition $definition, array $options = [])
9090
{
9191
if ($showArguments = \count($definition->getArguments()) > 0) {
9292
$this->write('### Arguments');
@@ -112,7 +112,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o
112112
/**
113113
* {@inheritdoc}
114114
*/
115-
protected function describeCommand(Command $command, array $options = array())
115+
protected function describeCommand(Command $command, array $options = [])
116116
{
117117
$command->getSynopsis();
118118
$command->mergeApplicationDefinition(false);
@@ -122,7 +122,7 @@ protected function describeCommand(Command $command, array $options = array())
122122
.str_repeat('-', Helper::strlen($command->getName()) + 2)."\n\n"
123123
.($command->getDescription() ? $command->getDescription()."\n\n" : '')
124124
.'### Usage'."\n\n"
125-
.array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
125+
.array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
126126
return $carry.'* `'.$usage.'`'."\n";
127127
})
128128
);
@@ -141,7 +141,7 @@ protected function describeCommand(Command $command, array $options = array())
141141
/**
142142
* {@inheritdoc}
143143
*/
144-
protected function describeApplication(Application $application, array $options = array())
144+
protected function describeApplication(Application $application, array $options = [])
145145
{
146146
$describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
147147
$description = new ApplicationDescription($application, $describedNamespace);

0 commit comments

Comments
 (0)