Skip to content

Commit 0eea0a8

Browse files
SpacePossumnicolas-grekas
authored andcommitted
[CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
1 parent fc26934 commit 0eea0a8

13 files changed

+25
-25
lines changed

Command/TranslationUpdateCommand.php

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

7474
// check presence of force or dump-message
75-
if ($input->getOption('force') !== true && $input->getOption('dump-messages') !== true) {
75+
if (true !== $input->getOption('force') && true !== $input->getOption('dump-messages')) {
7676
$output->error('You must choose one of --force or --dump-messages');
7777

7878
return 1;
@@ -151,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
151151
}
152152

153153
// show compiled list of messages
154-
if ($input->getOption('dump-messages') === true) {
154+
if (true === $input->getOption('dump-messages')) {
155155
$output->newLine();
156156
foreach ($operation->getDomains() as $domain) {
157157
$output->section(sprintf('Displaying messages for domain <info>%s</info>:', $domain));
@@ -168,17 +168,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
168168
));
169169
}
170170

171-
if ($input->getOption('output-format') == 'xlf') {
171+
if ('xlf' == $input->getOption('output-format')) {
172172
$output->writeln('Xliff output version is <info>1.2</info>');
173173
}
174174
}
175175

176-
if ($input->getOption('no-backup') === true) {
176+
if (true === $input->getOption('no-backup')) {
177177
$writer->disableBackup();
178178
}
179179

180180
// save the files
181-
if ($input->getOption('force') === true) {
181+
if (true === $input->getOption('force')) {
182182
$output->text('Writing files');
183183

184184
$bundleTransPath = false;

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
@@ -46,7 +46,7 @@ public function templateAction($template, $maxAge = null, $sharedAge = null, $pr
4646

4747
if ($private) {
4848
$response->setPrivate();
49-
} elseif ($private === false || (null === $private && ($maxAge || $sharedAge))) {
49+
} elseif (false === $private || (null === $private && ($maxAge || $sharedAge))) {
5050
$response->setPublic();
5151
}
5252

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
@@ -77,7 +77,7 @@ private static function getPhpUnitCliConfigArgument()
7777
$dir = null;
7878
$reversedArgs = array_reverse($_SERVER['argv']);
7979
foreach ($reversedArgs as $argIndex => $testArg) {
80-
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
80+
if (preg_match('/^-[^ \-]*c$/', $testArg) || '--configuration' === $testArg) {
8181
$dir = realpath($reversedArgs[$argIndex - 1]);
8282
break;
8383
} 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)