Skip to content

Commit 5d5a797

Browse files
committed
Fix CS
1 parent 81a439b commit 5d5a797

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

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) {

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:

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
}

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()

0 commit comments

Comments
 (0)