Skip to content

Commit f239da5

Browse files
Merge branch '2.7' into 2.8
* 2.7: [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
2 parents 0351f91 + 0eea0a8 commit f239da5

14 files changed

+25
-25
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7373
$io = new SymfonyStyle($input, $output);
7474

7575
// check presence of force or dump-message
76-
if ($input->getOption('force') !== true && $input->getOption('dump-messages') !== true) {
76+
if (true !== $input->getOption('force') && true !== $input->getOption('dump-messages')) {
7777
$io->error('You must choose one of --force or --dump-messages');
7878

7979
return 1;
@@ -179,19 +179,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
179179
$extractedMessagesCount += $domainMessagesCount;
180180
}
181181

182-
if ($input->getOption('output-format') == 'xlf') {
182+
if ('xlf' == $input->getOption('output-format')) {
183183
$io->comment('Xliff output version is <info>1.2</info>');
184184
}
185185

186186
$resultMessage = sprintf('%d message%s successfully extracted', $extractedMessagesCount, $extractedMessagesCount > 1 ? 's were' : ' was');
187187
}
188188

189-
if ($input->getOption('no-backup') === true) {
189+
if (true === $input->getOption('no-backup')) {
190190
$writer->disableBackup();
191191
}
192192

193193
// save the files
194-
if ($input->getOption('force') === true) {
194+
if (true === $input->getOption('force')) {
195195
$io->comment('Writing files...');
196196

197197
$bundleTransPath = false;

Command/YamlLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInf
142142
}
143143
}
144144

145-
if ($errors === 0) {
145+
if (0 === $errors) {
146146
$io->success(sprintf('All %d YAML files contain valid syntax.', count($filesInfo)));
147147
} else {
148148
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.', count($filesInfo) - $errors, $errors));

Controller/ControllerNameParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function findAlternative($nonExistentBundleName)
141141
}
142142

143143
$lev = levenshtein($nonExistentBundleName, $bundleName);
144-
if ($lev <= strlen($nonExistentBundleName) / 3 && ($alternative === null || $lev < $shortest)) {
144+
if ($lev <= strlen($nonExistentBundleName) / 3 && (null === $alternative || $lev < $shortest)) {
145145
$alternative = $bundleName;
146146
$shortest = $lev;
147147
}

Controller/RedirectController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function urlRedirectAction(Request $request, $path, $permanent = false, $
100100

101101
$qs = $request->getQueryString();
102102
if ($qs) {
103-
if (strpos($path, '?') === false) {
103+
if (false === strpos($path, '?')) {
104104
$qs = '?'.$qs;
105105
} else {
106106
$qs = '&'.$qs;

Controller/TemplateController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function templateAction($template, $maxAge = null, $sharedAge = null, $pr
5151

5252
if ($private) {
5353
$response->setPrivate();
54-
} elseif ($private === false || (null === $private && ($maxAge || $sharedAge))) {
54+
} elseif (false === $private || (null === $private && ($maxAge || $sharedAge))) {
5555
$response->setPublic();
5656
}
5757

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<tr>
22
<td></td>
33
<td>
4-
<?php echo $view['form']->widget($form) ?>
4+
<?php echo $view['form']->widget($form); ?>
55
</td>
66
</tr>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<tr>
22
<td>
3-
<?php echo $view['form']->label($form) ?>
3+
<?php echo $view['form']->label($form); ?>
44
</td>
55
<td>
6-
<?php echo $view['form']->errors($form) ?>
7-
<?php echo $view['form']->widget($form) ?>
6+
<?php echo $view['form']->errors($form); ?>
7+
<?php echo $view['form']->widget($form); ?>
88
</td>
99
</tr>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<table <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
1+
<table <?php echo $view['form']->block($form, 'widget_container_attributes'); ?>>
22
<?php if (!$form->parent && $errors): ?>
33
<tr>
44
<td colspan="2">
5-
<?php echo $view['form']->errors($form) ?>
5+
<?php echo $view['form']->errors($form); ?>
66
</td>
77
</tr>
8-
<?php endif ?>
9-
<?php echo $view['form']->block($form, 'form_rows') ?>
10-
<?php echo $view['form']->rest($form) ?>
8+
<?php endif; ?>
9+
<?php echo $view['form']->block($form, 'form_rows'); ?>
10+
<?php echo $view['form']->rest($form); ?>
1111
</table>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<tr style="display: none">
22
<td colspan="2">
3-
<?php echo $view['form']->widget($form) ?>
3+
<?php echo $view['form']->widget($form); ?>
44
</td>
55
</tr>

Test/KernelTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static function getPhpUnitCliConfigArgument()
7878
$dir = null;
7979
$reversedArgs = array_reverse($_SERVER['argv']);
8080
foreach ($reversedArgs as $argIndex => $testArg) {
81-
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
81+
if (preg_match('/^-[^ \-]*c$/', $testArg) || '--configuration' === $testArg) {
8282
$dir = realpath($reversedArgs[$argIndex - 1]);
8383
break;
8484
} elseif (0 === strpos($testArg, '--configuration=')) {

Tests/Templating/Helper/Fixtures/StubTemplateNameParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function parse($name)
3030
{
3131
list($bundle, $controller, $template) = explode(':', $name, 3);
3232

33-
if ($template[0] == '_') {
33+
if ('_' == $template[0]) {
3434
$path = $this->rootTheme.'/Custom/'.$template;
35-
} elseif ($bundle === 'TestBundle') {
35+
} elseif ('TestBundle' === $bundle) {
3636
$path = $this->rootTheme.'/'.$controller.'/'.$template;
3737
} else {
3838
$path = $this->root.'/'.$controller.'/'.$template;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<label><?php echo $global ?>child</label>
1+
<label><?php echo $global; ?>child</label>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<?php $type = isset($type) ? $type : 'text' ?>
2-
<input type="<?php echo $type ?>" <?php $view['form']->block($form, 'widget_attributes') ?> value="<?php echo $value ?>" rel="theme" />
1+
<?php $type = isset($type) ? $type : 'text'; ?>
2+
<input type="<?php echo $type; ?>" <?php $view['form']->block($form, 'widget_attributes'); ?> value="<?php echo $value; ?>" rel="theme" />

Tests/Templating/TemplateFilenameParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testParseFromFilename($file, $ref)
3636
{
3737
$template = $this->parser->parse($file);
3838

39-
if ($ref === false) {
39+
if (false === $ref) {
4040
$this->assertFalse($template);
4141
} else {
4242
$this->assertEquals($template->getLogicalName(), $ref->getLogicalName());

0 commit comments

Comments
 (0)