Skip to content

Commit 4eaedb4

Browse files
committed
minor symfony#46990 Fix CS on 4.4 (fabpot)
This PR was merged into the 4.4 branch. Discussion ---------- Fix CS on 4.4 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | n/a Commits ------- 4ec0eda Fix CS
2 parents 1f0cece + 4ec0eda commit 4eaedb4

File tree

115 files changed

+824
-787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+824
-787
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function addLogger($name, DebugStack $logger)
5959
*
6060
* @param \Throwable|null $exception
6161
*/
62-
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
62+
public function collect(Request $request, Response $response/* , \Throwable $exception = null */)
6363
{
6464
$queries = [];
6565
foreach ($this->loggers as $name => $logger) {

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ public function guessType($class, $property)
6060

6161
switch ($metadata->getTypeOfField($property)) {
6262
case self::$useDeprecatedConstants ? Type::TARRAY : Types::ARRAY:
63+
// no break
6364
case self::$useDeprecatedConstants ? Type::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
6465
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CollectionType', [], Guess::MEDIUM_CONFIDENCE);
6566
case self::$useDeprecatedConstants ? Type::BOOLEAN : Types::BOOLEAN:
6667
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', [], Guess::HIGH_CONFIDENCE);
6768
case self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE:
69+
// no break
6870
case self::$useDeprecatedConstants ? Type::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
71+
// no break
6972
case 'vardatetime':
7073
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', [], Guess::HIGH_CONFIDENCE);
7174
case 'datetime_immutable':
@@ -86,7 +89,9 @@ public function guessType($class, $property)
8689
case self::$useDeprecatedConstants ? Type::FLOAT : Types::FLOAT:
8790
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', [], Guess::MEDIUM_CONFIDENCE);
8891
case self::$useDeprecatedConstants ? Type::INTEGER : Types::INTEGER:
92+
// no break
8993
case self::$useDeprecatedConstants ? Type::BIGINT : Types::BIGINT:
94+
// no break
9095
case self::$useDeprecatedConstants ? Type::SMALLINT : Types::SMALLINT:
9196
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\IntegerType', [], Guess::MEDIUM_CONFIDENCE);
9297
case self::$useDeprecatedConstants ? Type::STRING : Types::STRING:

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ public function getTypes($class, $property, array $context = [])
168168
case Type::BUILTIN_TYPE_OBJECT:
169169
switch ($typeOfField) {
170170
case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE:
171+
// no break
171172
case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE:
173+
// no break
172174
case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
175+
// no break
173176
case 'vardatetime':
174177
case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE:
175178
return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')];
@@ -188,6 +191,7 @@ public function getTypes($class, $property, array $context = [])
188191
case Type::BUILTIN_TYPE_ARRAY:
189192
switch ($typeOfField) {
190193
case self::$useDeprecatedConstants ? DBALType::TARRAY : Types::ARRAY:
194+
// no break
191195
case 'json_array':
192196
// return null if $enumType is set, because we can't determine if collectionKeyType is string or int
193197
if ($enumType) {
@@ -279,32 +283,43 @@ private function getPhpType(string $doctrineType): ?string
279283
{
280284
switch ($doctrineType) {
281285
case self::$useDeprecatedConstants ? DBALType::SMALLINT : Types::SMALLINT:
286+
// no break
282287
case self::$useDeprecatedConstants ? DBALType::INTEGER : Types::INTEGER:
283288
return Type::BUILTIN_TYPE_INT;
284289

285290
case self::$useDeprecatedConstants ? DBALType::FLOAT : Types::FLOAT:
286291
return Type::BUILTIN_TYPE_FLOAT;
287292

288293
case self::$useDeprecatedConstants ? DBALType::BIGINT : Types::BIGINT:
294+
// no break
289295
case self::$useDeprecatedConstants ? DBALType::STRING : Types::STRING:
296+
// no break
290297
case self::$useDeprecatedConstants ? DBALType::TEXT : Types::TEXT:
298+
// no break
291299
case self::$useDeprecatedConstants ? DBALType::GUID : Types::GUID:
300+
// no break
292301
case self::$useDeprecatedConstants ? DBALType::DECIMAL : Types::DECIMAL:
293302
return Type::BUILTIN_TYPE_STRING;
294303

295304
case self::$useDeprecatedConstants ? DBALType::BOOLEAN : Types::BOOLEAN:
296305
return Type::BUILTIN_TYPE_BOOL;
297306

298307
case self::$useDeprecatedConstants ? DBALType::BLOB : Types::BLOB:
308+
// no break
299309
case 'binary':
300310
return Type::BUILTIN_TYPE_RESOURCE;
301311

302312
case self::$useDeprecatedConstants ? DBALType::OBJECT : Types::OBJECT:
313+
// no break
303314
case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE:
315+
// no break
304316
case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE:
317+
// no break
305318
case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE:
319+
// no break
306320
case 'vardatetime':
307321
case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE:
322+
// no break
308323
case 'date_immutable':
309324
case 'datetime_immutable':
310325
case 'datetimetz_immutable':
@@ -313,7 +328,9 @@ private function getPhpType(string $doctrineType): ?string
313328
return Type::BUILTIN_TYPE_OBJECT;
314329

315330
case self::$useDeprecatedConstants ? DBALType::TARRAY : Types::ARRAY:
331+
// no break
316332
case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
333+
// no break
317334
case 'json_array':
318335
return Type::BUILTIN_TYPE_ARRAY;
319336
}

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ public function testLoadChoicesForValuesLoadsOnlyChoicesIfSingleIntId()
315315

316316
$this->assertSame(
317317
[4 => $this->obj3, 7 => $this->obj2],
318-
$loader->loadChoicesForValues([4 => '3', 7 => '2']
319-
));
318+
$loader->loadChoicesForValues([4 => '3', 7 => '2'])
319+
);
320320
}
321321

322322
public function testLoadChoicesForValuesLoadsAllIfSingleIntIdAndValueGiven()

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(Profile $profile, Environment $twig = null)
4545
*
4646
* @param \Throwable|null $exception
4747
*/
48-
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
48+
public function collect(Request $request, Response $response/* , \Throwable $exception = null */)
4949
{
5050
}
5151

src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testLabelOnForm()
2121
$html = $this->renderLabel($view);
2222

2323
$this->assertMatchesXpath($html,
24-
'/label
24+
'/label
2525
[@class="col-sm-2 control-label required"]
2626
[.="[trans]Name[/trans]"]
2727
'
@@ -38,7 +38,7 @@ public function testLabelDoesNotRenderFieldAttributes()
3838
]);
3939

4040
$this->assertMatchesXpath($html,
41-
'/label
41+
'/label
4242
[@for="name"]
4343
[@class="col-sm-2 control-label required"]
4444
'
@@ -55,7 +55,7 @@ public function testLabelWithCustomAttributesPassedDirectly()
5555
]);
5656

5757
$this->assertMatchesXpath($html,
58-
'/label
58+
'/label
5959
[@for="name"]
6060
[@class="my&class col-sm-2 control-label required"]
6161
'
@@ -72,7 +72,7 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly()
7272
]);
7373

7474
$this->assertMatchesXpath($html,
75-
'/label
75+
'/label
7676
[@for="name"]
7777
[@class="my&class col-sm-2 control-label required"]
7878
[.="[trans]Custom label[/trans]"]
@@ -92,7 +92,7 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly
9292
]);
9393

9494
$this->assertMatchesXpath($html,
95-
'/label
95+
'/label
9696
[@for="name"]
9797
[@class="my&class col-sm-2 control-label required"]
9898
[.="[trans]Custom label[/trans]"]
@@ -170,7 +170,7 @@ public function testCheckboxRowWithHelp()
170170
$html = $this->renderRow($form->createView(), ['label' => 'foo', 'help' => 'really helpful text']);
171171

172172
$this->assertMatchesXpath($html,
173-
'/div
173+
'/div
174174
[@class="form-group"]
175175
[
176176
./div[@class="col-sm-2" or @class="col-sm-10"]

0 commit comments

Comments
 (0)