Skip to content

Commit 5c9913f

Browse files
Merge branch '2.8' into 3.3
* 2.8: [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction [Filesystem] mirror - fix copying content with same name as source/target. .php_cs.dist - simplify config [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2 parents 8b1bb78 + f239da5 commit 5c9913f

16 files changed

+29
-29
lines changed

Command/ConfigDumpReferenceCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9494
$format = $input->getOption('format');
9595
$path = $input->getArgument('path');
9696

97-
if ($path !== null && 'yaml' !== $format) {
97+
if (null !== $path && 'yaml' !== $format) {
9898
$errorIo->error('The "path" option is only available for the "yaml" format.');
9999

100100
return 1;
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
106106
$message = sprintf('Default configuration for "%s"', $name);
107107
}
108108

109-
if ($path !== null) {
109+
if (null !== $path) {
110110
$message .= sprintf(' at path "%s"', $path);
111111
}
112112

Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888
$errorIo = $io->getErrorStyle();
8989

9090
// check presence of force or dump-message
91-
if ($input->getOption('force') !== true && $input->getOption('dump-messages') !== true) {
91+
if (true !== $input->getOption('force') && true !== $input->getOption('dump-messages')) {
9292
$errorIo->error('You must choose one of --force or --dump-messages');
9393

9494
return 1;
@@ -199,19 +199,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
199199
$extractedMessagesCount += $domainMessagesCount;
200200
}
201201

202-
if ($input->getOption('output-format') == 'xlf') {
202+
if ('xlf' == $input->getOption('output-format')) {
203203
$errorIo->comment('Xliff output version is <info>1.2</info>');
204204
}
205205

206206
$resultMessage = sprintf('%d message%s successfully extracted', $extractedMessagesCount, $extractedMessagesCount > 1 ? 's were' : ' was');
207207
}
208208

209-
if ($input->getOption('no-backup') === true) {
209+
if (true === $input->getOption('no-backup')) {
210210
$writer->disableBackup();
211211
}
212212

213213
// save the files
214-
if ($input->getOption('force') === true) {
214+
if (true === $input->getOption('force')) {
215215
$errorIo->comment('Writing files...');
216216

217217
$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/ControllerTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function json($data, $status = 200, $headers = array(), $context = arr
136136
protected function file($file, $fileName = null, $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT)
137137
{
138138
$response = new BinaryFileResponse($file);
139-
$response->setContentDisposition($disposition, $fileName === null ? $response->getFile()->getFilename() : $fileName);
139+
$response->setContentDisposition($disposition, null === $fileName ? $response->getFile()->getFilename() : $fileName);
140140

141141
return $response;
142142
}

Controller/RedirectController.php

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

104104
$qs = $request->getQueryString();
105105
if ($qs) {
106-
if (strpos($path, '?') === false) {
106+
if (false === strpos($path, '?')) {
107107
$qs = '?'.$qs;
108108
} else {
109109
$qs = '&'.$qs;

Controller/TemplateController.php

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

5555
if ($private) {
5656
$response->setPrivate();
57-
} elseif ($private === false || (null === $private && ($maxAge || $sharedAge))) {
57+
} elseif (false === $private || (null === $private && ($maxAge || $sharedAge))) {
5858
$response->setPublic();
5959
}
6060

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ private function registerWorkflowConfiguration(array $workflows, ContainerBuilde
516516

517517
$transitions = array();
518518
foreach ($workflow['transitions'] as $transition) {
519-
if ($type === 'workflow') {
519+
if ('workflow' === $type) {
520520
$transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $transition['from'], $transition['to']));
521-
} elseif ($type === 'state_machine') {
521+
} elseif ('state_machine' === $type) {
522522
foreach ($transition['from'] as $from) {
523523
foreach ($transition['to'] as $to) {
524524
$transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $from, $to));
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)