Skip to content

Commit fa5c798

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 0897c7c + c13dae2 commit fa5c798

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function reverseTransform($value)
135135
throw new TransformationFailedException('The value of "invert" must be boolean');
136136
}
137137
foreach (self::$availableFields as $field => $char) {
138-
if ($field !== 'invert' && isset($value[$field]) && !ctype_digit((string) $value[$field])) {
138+
if ('invert' !== $field && isset($value[$field]) && !ctype_digit((string) $value[$field])) {
139139
throw new TransformationFailedException(sprintf('This amount of "%s" is invalid', $field));
140140
}
141141
}

Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function transform($dateTime)
8989

9090
$value = $this->getIntlDateFormatter()->format($dateTime->getTimestamp());
9191

92-
if (intl_get_error_code() != 0) {
92+
if (0 != intl_get_error_code()) {
9393
throw new TransformationFailedException(intl_get_error_message());
9494
}
9595

@@ -122,7 +122,7 @@ public function reverseTransform($value)
122122

123123
$timestamp = $this->getIntlDateFormatter($dateOnly)->parse($value);
124124

125-
if (intl_get_error_code() != 0) {
125+
if (0 != intl_get_error_code()) {
126126
throw new TransformationFailedException(intl_get_error_message());
127127
}
128128

Extension/Core/Type/DateIntervalType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function configureOptions(OptionsResolver $resolver)
178178
{
179179
$timeParts = $this->timeParts;
180180
$compound = function (Options $options) {
181-
return $options['widget'] !== 'single_text';
181+
return 'single_text' !== $options['widget'];
182182
};
183183

184184
$placeholderDefault = function (Options $options) {

Extension/Csrf/EventListener/CsrfValidationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct($fieldName, CsrfTokenManagerInterface $tokenManager,
9292
public function preSubmit(FormEvent $event)
9393
{
9494
$form = $event->getForm();
95-
$postRequestSizeExceeded = $form->getConfig()->getMethod() === 'POST' && $this->serverParams->hasPostMaxSizeBeenExceeded();
95+
$postRequestSizeExceeded = 'POST' === $form->getConfig()->getMethod() && $this->serverParams->hasPostMaxSizeBeenExceeded();
9696

9797
if ($form->isRoot() && $form->getConfig()->getOption('compound') && !$postRequestSizeExceeded) {
9898
$data = $event->getData();

Test/FormPerformanceTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function runTest()
3535
parent::runTest();
3636
$time = microtime(true) - $s;
3737

38-
if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) {
38+
if (0 != $this->maxRunningTime && $time > $this->maxRunningTime) {
3939
$this->fail(
4040
sprintf(
4141
'expected running time: <= %s but was: %s',

Tests/AbstractLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ protected function assertMatchesXpath($html, $expression, $count = 1)
7878
$this->fail(sprintf(
7979
"Failed asserting that \n\n%s\n\nmatches exactly %s. Matches %s in \n\n%s",
8080
$expression,
81-
$count == 1 ? 'once' : $count.' times',
82-
$nodeList->length == 1 ? 'once' : $nodeList->length.' times',
81+
1 == $count ? 'once' : $count.' times',
82+
1 == $nodeList->length ? 'once' : $nodeList->length.' times',
8383
// strip away <root> and </root>
8484
substr($dom->saveHTML(), 6, -8)
8585
));

Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ public function testCustomDataErrorMapping($target, $mapFrom, $mapTo, $childName
12601260
// Only add it if we expect the error to come up on a different
12611261
// level than LEVEL_0, because in this case the error would
12621262
// (correctly) be mapped to the distraction field
1263-
if ($target !== self::LEVEL_0) {
1263+
if (self::LEVEL_0 !== $target) {
12641264
$mapFromPath = new PropertyPath($mapFrom);
12651265
$mapFromPrefix = $mapFromPath->isIndex(0)
12661266
? '['.$mapFromPath->getElement(0).']'
@@ -1274,7 +1274,7 @@ public function testCustomDataErrorMapping($target, $mapFrom, $mapTo, $childName
12741274

12751275
$this->mapper->mapViolation($violation, $parent);
12761276

1277-
if ($target !== self::LEVEL_0) {
1277+
if (self::LEVEL_0 !== $target) {
12781278
$this->assertCount(0, $distraction->getErrors(), 'distraction should not have an error, but has one');
12791279
}
12801280

Tests/Fixtures/AlternatingRowType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
1515

1616
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($formFactory) {
1717
$form = $event->getForm();
18-
$type = $form->getName() % 2 === 0
18+
$type = 0 === $form->getName() % 2
1919
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
2020
: 'Symfony\Component\Form\Extension\Core\Type\TextareaType';
2121
$form->add('title', $type);

Tests/Fixtures/FixedDataTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function reverseTransform($value)
3636
{
3737
$result = array_search($value, $this->mapping, true);
3838

39-
if ($result === false) {
39+
if (false === $result) {
4040
throw new TransformationFailedException(sprintf('No reverse mapping for value "%s"', $value));
4141
}
4242

0 commit comments

Comments
 (0)