Skip to content

Commit 3daf10d

Browse files
committed
Merge branch '2.5'
* 2.5: added missing use statements added missing use statement added missing use statement fixed CS [Process] fixed some volatile tests [HttpKernel] fixed a volatile test [HttpFoundation] fixed some volatile tests [Tests] PHPUnit Optimizations Use getPathname() instead of string casting to get BinaryFileReponse file path Conflicts: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php src/Symfony/Component/Process/Process.php src/Symfony/Component/Stopwatch/Stopwatch.php src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/InlineTest.php
2 parents 0f682ba + c1c5657 commit 3daf10d

19 files changed

+71
-69
lines changed

Formatter/OutputFormatterStyle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
2828
'blue' => array('set' => 34, 'unset' => 39),
2929
'magenta' => array('set' => 35, 'unset' => 39),
3030
'cyan' => array('set' => 36, 'unset' => 39),
31-
'white' => array('set' => 37, 'unset' => 39)
31+
'white' => array('set' => 37, 'unset' => 39),
3232
);
3333
private static $availableBackgroundColors = array(
3434
'black' => array('set' => 40, 'unset' => 49),
@@ -38,14 +38,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
3838
'blue' => array('set' => 44, 'unset' => 49),
3939
'magenta' => array('set' => 45, 'unset' => 49),
4040
'cyan' => array('set' => 46, 'unset' => 49),
41-
'white' => array('set' => 47, 'unset' => 49)
41+
'white' => array('set' => 47, 'unset' => 49),
4242
);
4343
private static $availableOptions = array(
4444
'bold' => array('set' => 1, 'unset' => 22),
4545
'underscore' => array('set' => 4, 'unset' => 24),
4646
'blink' => array('set' => 5, 'unset' => 25),
4747
'reverse' => array('set' => 7, 'unset' => 27),
48-
'conceal' => array('set' => 8, 'unset' => 28)
48+
'conceal' => array('set' => 8, 'unset' => 28),
4949
);
5050

5151
private $foreground;

Helper/DialogHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public function ask(OutputInterface $output, $question, $default = null, array $
153153

154154
// Pop the last character off the end of our string
155155
$ret = substr($ret, 0, $i);
156-
} elseif ("\033" === $c) { // Did we read an escape sequence?
156+
} elseif ("\033" === $c) {
157+
// Did we read an escape sequence?
157158
$c .= fread($inputStream, 2);
158159

159160
// A = Up Arrow. B = Down Arrow

Helper/ProcessHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public function wrapCallback(OutputInterface $output, Process $process, $callbac
112112
$formatter = $this->getHelperSet()->get('debug_formatter');
113113

114114
$that = $this;
115+
115116
return function ($type, $buffer) use ($output, $process, $callback, $formatter, $that) {
116117
$output->write($formatter->progress(spl_object_hash($process), $that->escapeString($buffer), Process::ERR === $type));
117118

Helper/QuestionHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
208208

209209
// Pop the last character off the end of our string
210210
$ret = substr($ret, 0, $i);
211-
} elseif ("\033" === $c) { // Did we read an escape sequence?
211+
} elseif ("\033" === $c) {
212+
// Did we read an escape sequence?
212213
$c .= fread($inputStream, 2);
213214

214215
// A = Up Arrow. B = Down Arrow

Input/ArgvInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private function parseArgument($token)
169169
// if input is expecting another argument, add it
170170
if ($this->definition->hasArgument($c)) {
171171
$arg = $this->definition->getArgument($c);
172-
$this->arguments[$arg->getName()] = $arg->isArray()? array($token) : $token;
172+
$this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token;
173173

174174
// if last argument isArray(), append token to last argument
175175
} elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
@@ -336,7 +336,7 @@ public function __toString()
336336
$self = $this;
337337
$tokens = array_map(function ($token) use ($self) {
338338
if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
339-
return $match[1] . $self->escapeToken($match[2]);
339+
return $match[1].$self->escapeToken($match[2]);
340340
}
341341

342342
if ($token && $token[0] !== '-') {

Input/ArrayInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function __toString()
120120
$params = array();
121121
foreach ($this->parameters as $param => $val) {
122122
if ($param && '-' === $param[0]) {
123-
$params[] = $param . ('' != $val ? '='.$this->escapeToken($val) : '');
123+
$params[] = $param.('' != $val ? '='.$this->escapeToken($val) : '');
124124
} else {
125125
$params[] = $this->escapeToken($val);
126126
}

Logger/ConsoleLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ConsoleLogger extends AbstractLogger
4343
LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
4444
LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE,
4545
LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE,
46-
LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG
46+
LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG,
4747
);
4848
/**
4949
* @var array
@@ -56,7 +56,7 @@ class ConsoleLogger extends AbstractLogger
5656
LogLevel::WARNING => self::INFO,
5757
LogLevel::NOTICE => self::INFO,
5858
LogLevel::INFO => self::INFO,
59-
LogLevel::DEBUG => self::INFO
59+
LogLevel::DEBUG => self::INFO,
6060
);
6161

6262
/**

Output/NullOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getVerbosity()
7474
{
7575
return self::VERBOSITY_QUIET;
7676
}
77-
77+
7878
public function isQuiet()
7979
{
8080
return true;

Tests/ApplicationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function provideAmbiguousAbbreviations()
270270
return array(
271271
array('f', 'Command "f" is not defined.'),
272272
array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'),
273-
array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1 and 1 more).')
273+
array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1 and 1 more).'),
274274
);
275275
}
276276

@@ -317,7 +317,7 @@ public function provideInvalidCommandNamesSingle()
317317
{
318318
return array(
319319
array('foo3:baR'),
320-
array('foO3:bar')
320+
array('foO3:bar'),
321321
);
322322
}
323323

Tests/Command/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function provideInvalidCommandNames()
111111
{
112112
return array(
113113
array(''),
114-
array('foo:')
114+
array('foo:'),
115115
);
116116
}
117117

Tests/Command/ListCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function testExecuteListsCommandsWithRawOption()
4949

5050
public function testExecuteListsCommandsWithNamespaceArgument()
5151
{
52-
5352
require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
5453
$application = new Application();
5554
$application->add(new \FooCommand());

Tests/Helper/DialogHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function testAskAndValidate()
134134
$helperSet = new HelperSet(array(new FormatterHelper()));
135135
$dialog->setHelperSet($helperSet);
136136

137-
$question ='What color was the white horse of Henry IV?';
137+
$question = 'What color was the white horse of Henry IV?';
138138
$error = 'This is not a color!';
139139
$validator = function ($color) use ($error) {
140140
if (!in_array($color, array('white', 'black'))) {

Tests/Helper/FormatterHelperTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function testFormatBlock()
3737
);
3838

3939
$this->assertEquals(
40-
'<error> Some text to display </error>'."\n" .
40+
'<error> Some text to display </error>'."\n".
4141
'<error> foo bar </error>',
4242
$formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'),
4343
'::formatBlock() formats a message in a block'
4444
);
4545

4646
$this->assertEquals(
47-
'<error> </error>'."\n" .
48-
'<error> Some text to display </error>'."\n" .
47+
'<error> </error>'."\n".
48+
'<error> Some text to display </error>'."\n".
4949
'<error> </error>',
5050
$formatter->formatBlock('Some text to display', 'error', true),
5151
'::formatBlock() formats a message in a block'
@@ -61,8 +61,8 @@ public function testFormatBlockWithDiacriticLetters()
6161
$formatter = new FormatterHelper();
6262

6363
$this->assertEquals(
64-
'<error> </error>'."\n" .
65-
'<error> Du texte à afficher </error>'."\n" .
64+
'<error> </error>'."\n".
65+
'<error> Du texte à afficher </error>'."\n".
6666
'<error> </error>',
6767
$formatter->formatBlock('Du texte à afficher', 'error', true),
6868
'::formatBlock() formats a message in a block'
@@ -76,8 +76,8 @@ public function testFormatBlockWithDoubleWidthDiacriticLetters()
7676
}
7777
$formatter = new FormatterHelper();
7878
$this->assertEquals(
79-
'<error> </error>'."\n" .
80-
'<error> 表示するテキスト </error>'."\n" .
79+
'<error> </error>'."\n".
80+
'<error> 表示するテキスト </error>'."\n".
8181
'<error> </error>',
8282
$formatter->formatBlock('表示するテキスト', 'error', true),
8383
'::formatBlock() formats a message in a block'
@@ -89,8 +89,8 @@ public function testFormatBlockLGEscaping()
8989
$formatter = new FormatterHelper();
9090

9191
$this->assertEquals(
92-
'<error> </error>'."\n" .
93-
'<error> \<info>some info\</info> </error>'."\n" .
92+
'<error> </error>'."\n".
93+
'<error> \<info>some info\</info> </error>'."\n".
9494
'<error> </error>',
9595
$formatter->formatBlock('<info>some info</info>', 'error', true),
9696
'::formatBlock() escapes \'<\' chars'

Tests/Helper/ProgressHelperTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public function testOverwriteWithShorterLine()
8888

8989
rewind($output->getStream());
9090
$this->assertEquals(
91-
$this->generateOutput(' 0/50 [>---------------------------] 0%') .
92-
$this->generateOutput(' 1/50 [>---------------------------] 2%') .
91+
$this->generateOutput(' 0/50 [>---------------------------] 0%').
92+
$this->generateOutput(' 1/50 [>---------------------------] 2%').
9393
$this->generateOutput(' 2/50 [=>--------------------------] '),
9494
stream_get_contents($output->getStream())
9595
);
@@ -106,9 +106,9 @@ public function testSetCurrentProgress()
106106

107107
rewind($output->getStream());
108108
$this->assertEquals(
109-
$this->generateOutput(' 0/50 [>---------------------------] 0%') .
110-
$this->generateOutput(' 1/50 [>---------------------------] 2%') .
111-
$this->generateOutput(' 15/50 [========>-------------------] 30%') .
109+
$this->generateOutput(' 0/50 [>---------------------------] 0%').
110+
$this->generateOutput(' 1/50 [>---------------------------] 2%').
111+
$this->generateOutput(' 15/50 [========>-------------------] 30%').
112112
$this->generateOutput(' 25/50 [==============>-------------] 50%'),
113113
stream_get_contents($output->getStream())
114114
);
@@ -175,7 +175,7 @@ public function testClear()
175175

176176
rewind($output->getStream());
177177
$this->assertEquals(
178-
$this->generateOutput(' 25/50 [==============>-------------] 50%') . $this->generateOutput(''),
178+
$this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''),
179179
stream_get_contents($output->getStream())
180180
);
181181
}

Tests/Input/ArgvInputTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,92 +57,92 @@ public function provideOptions()
5757
array('cli.php', '--foo'),
5858
array(new InputOption('foo')),
5959
array('foo' => true),
60-
'->parse() parses long options without a value'
60+
'->parse() parses long options without a value',
6161
),
6262
array(
6363
array('cli.php', '--foo=bar'),
6464
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
6565
array('foo' => 'bar'),
66-
'->parse() parses long options with a required value (with a = separator)'
66+
'->parse() parses long options with a required value (with a = separator)',
6767
),
6868
array(
6969
array('cli.php', '--foo', 'bar'),
7070
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
7171
array('foo' => 'bar'),
72-
'->parse() parses long options with a required value (with a space separator)'
72+
'->parse() parses long options with a required value (with a space separator)',
7373
),
7474
array(
7575
array('cli.php', '-f'),
7676
array(new InputOption('foo', 'f')),
7777
array('foo' => true),
78-
'->parse() parses short options without a value'
78+
'->parse() parses short options without a value',
7979
),
8080
array(
8181
array('cli.php', '-fbar'),
8282
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
8383
array('foo' => 'bar'),
84-
'->parse() parses short options with a required value (with no separator)'
84+
'->parse() parses short options with a required value (with no separator)',
8585
),
8686
array(
8787
array('cli.php', '-f', 'bar'),
8888
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
8989
array('foo' => 'bar'),
90-
'->parse() parses short options with a required value (with a space separator)'
90+
'->parse() parses short options with a required value (with a space separator)',
9191
),
9292
array(
9393
array('cli.php', '-f', ''),
9494
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
9595
array('foo' => ''),
96-
'->parse() parses short options with an optional empty value'
96+
'->parse() parses short options with an optional empty value',
9797
),
9898
array(
9999
array('cli.php', '-f', '', 'foo'),
100100
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
101101
array('foo' => ''),
102-
'->parse() parses short options with an optional empty value followed by an argument'
102+
'->parse() parses short options with an optional empty value followed by an argument',
103103
),
104104
array(
105105
array('cli.php', '-f', '', '-b'),
106106
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
107107
array('foo' => '', 'bar' => true),
108-
'->parse() parses short options with an optional empty value followed by an option'
108+
'->parse() parses short options with an optional empty value followed by an option',
109109
),
110110
array(
111111
array('cli.php', '-f', '-b', 'foo'),
112112
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
113113
array('foo' => null, 'bar' => true),
114-
'->parse() parses short options with an optional value which is not present'
114+
'->parse() parses short options with an optional value which is not present',
115115
),
116116
array(
117117
array('cli.php', '-fb'),
118118
array(new InputOption('foo', 'f'), new InputOption('bar', 'b')),
119119
array('foo' => true, 'bar' => true),
120-
'->parse() parses short options when they are aggregated as a single one'
120+
'->parse() parses short options when they are aggregated as a single one',
121121
),
122122
array(
123123
array('cli.php', '-fb', 'bar'),
124124
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)),
125125
array('foo' => true, 'bar' => 'bar'),
126-
'->parse() parses short options when they are aggregated as a single one and the last one has a required value'
126+
'->parse() parses short options when they are aggregated as a single one and the last one has a required value',
127127
),
128128
array(
129129
array('cli.php', '-fb', 'bar'),
130130
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
131131
array('foo' => true, 'bar' => 'bar'),
132-
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value'
132+
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value',
133133
),
134134
array(
135135
array('cli.php', '-fbbar'),
136136
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
137137
array('foo' => true, 'bar' => 'bar'),
138-
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator'
138+
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator',
139139
),
140140
array(
141141
array('cli.php', '-fbbar'),
142142
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
143143
array('foo' => 'bbar', 'bar' => null),
144-
'->parse() parses short options when they are aggregated as a single one and one of them takes a value'
145-
)
144+
'->parse() parses short options when they are aggregated as a single one and one of them takes a value',
145+
),
146146
);
147147
}
148148

@@ -163,43 +163,43 @@ public function provideInvalidInput()
163163
array(
164164
array('cli.php', '--foo'),
165165
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
166-
'The "--foo" option requires a value.'
166+
'The "--foo" option requires a value.',
167167
),
168168
array(
169169
array('cli.php', '-f'),
170170
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
171-
'The "--foo" option requires a value.'
171+
'The "--foo" option requires a value.',
172172
),
173173
array(
174174
array('cli.php', '-ffoo'),
175175
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
176-
'The "-o" option does not exist.'
176+
'The "-o" option does not exist.',
177177
),
178178
array(
179179
array('cli.php', '--foo=bar'),
180180
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
181-
'The "--foo" option does not accept a value.'
181+
'The "--foo" option does not accept a value.',
182182
),
183183
array(
184184
array('cli.php', 'foo', 'bar'),
185185
new InputDefinition(),
186-
'Too many arguments.'
186+
'Too many arguments.',
187187
),
188188
array(
189189
array('cli.php', '--foo'),
190190
new InputDefinition(),
191-
'The "--foo" option does not exist.'
191+
'The "--foo" option does not exist.',
192192
),
193193
array(
194194
array('cli.php', '-f'),
195195
new InputDefinition(),
196-
'The "-f" option does not exist.'
196+
'The "-f" option does not exist.',
197197
),
198198
array(
199199
array('cli.php', '-1'),
200200
new InputDefinition(array(new InputArgument('number'))),
201-
'The "-1" option does not exist.'
202-
)
201+
'The "-1" option does not exist.',
202+
),
203203
);
204204
}
205205

0 commit comments

Comments
 (0)