From bbc57b339de9cdf21a55d0b79e7d93172a70e384 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 17 Aug 2020 09:16:16 +0200 Subject: [PATCH] Fix CS --- Form/DoctrineOrmTypeGuesser.php | 5 +++++ PropertyInfo/DoctrineExtractor.php | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Form/DoctrineOrmTypeGuesser.php b/Form/DoctrineOrmTypeGuesser.php index 4ab64b42..6e4e1128 100644 --- a/Form/DoctrineOrmTypeGuesser.php +++ b/Form/DoctrineOrmTypeGuesser.php @@ -69,7 +69,9 @@ public function guessType($class, $property) case self::$useDeprecatedConstants ? Type::BOOLEAN : Types::BOOLEAN: return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', [], Guess::HIGH_CONFIDENCE); case self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE: + // no break case self::$useDeprecatedConstants ? Type::DATETIMETZ : Types::DATETIMETZ_MUTABLE: + // no break case 'vardatetime': return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', [], Guess::HIGH_CONFIDENCE); case 'dateinterval': @@ -79,10 +81,13 @@ public function guessType($class, $property) case self::$useDeprecatedConstants ? Type::TIME : Types::TIME_MUTABLE: return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', [], Guess::HIGH_CONFIDENCE); case self::$useDeprecatedConstants ? Type::DECIMAL : Types::DECIMAL: + // no break case self::$useDeprecatedConstants ? Type::FLOAT : Types::FLOAT: return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', [], Guess::MEDIUM_CONFIDENCE); case self::$useDeprecatedConstants ? Type::INTEGER : Types::INTEGER: + // no break case self::$useDeprecatedConstants ? Type::BIGINT : Types::BIGINT: + // no break case self::$useDeprecatedConstants ? Type::SMALLINT : Types::SMALLINT: return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\IntegerType', [], Guess::MEDIUM_CONFIDENCE); case self::$useDeprecatedConstants ? Type::STRING : Types::STRING: diff --git a/PropertyInfo/DoctrineExtractor.php b/PropertyInfo/DoctrineExtractor.php index 8917ce43..bafd97a5 100644 --- a/PropertyInfo/DoctrineExtractor.php +++ b/PropertyInfo/DoctrineExtractor.php @@ -157,8 +157,11 @@ public function getTypes($class, $property, array $context = []) case Type::BUILTIN_TYPE_OBJECT: switch ($typeOfField) { case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE: + // no break case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE: + // no break case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE: + // no break case 'vardatetime': case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE: return [new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')]; @@ -177,6 +180,7 @@ public function getTypes($class, $property, array $context = []) case Type::BUILTIN_TYPE_ARRAY: switch ($typeOfField) { case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array': + // no break case 'json_array': return [new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true)]; @@ -229,6 +233,7 @@ private function getPhpType($doctrineType) { switch ($doctrineType) { case self::$useDeprecatedConstants ? DBALType::SMALLINT : Types::SMALLINT: + // no break case self::$useDeprecatedConstants ? DBALType::INTEGER : Types::INTEGER: return Type::BUILTIN_TYPE_INT; @@ -236,9 +241,13 @@ private function getPhpType($doctrineType) return Type::BUILTIN_TYPE_FLOAT; case self::$useDeprecatedConstants ? DBALType::BIGINT : Types::BIGINT: + // no break case self::$useDeprecatedConstants ? DBALType::STRING : Types::STRING: + // no break case self::$useDeprecatedConstants ? DBALType::TEXT : Types::TEXT: + // no break case self::$useDeprecatedConstants ? DBALType::GUID : Types::GUID: + // no break case self::$useDeprecatedConstants ? DBALType::DECIMAL : Types::DECIMAL: return Type::BUILTIN_TYPE_STRING; @@ -246,15 +255,21 @@ private function getPhpType($doctrineType) return Type::BUILTIN_TYPE_BOOL; case self::$useDeprecatedConstants ? DBALType::BLOB : Types::BLOB: + // no break case 'binary': return Type::BUILTIN_TYPE_RESOURCE; case self::$useDeprecatedConstants ? DBALType::OBJECT : Types::OBJECT: + // no break case self::$useDeprecatedConstants ? DBALType::DATE : Types::DATE_MUTABLE: + // no break case self::$useDeprecatedConstants ? DBALType::DATETIME : Types::DATETIME_MUTABLE: + // no break case self::$useDeprecatedConstants ? DBALType::DATETIMETZ : Types::DATETIMETZ_MUTABLE: + // no break case 'vardatetime': case self::$useDeprecatedConstants ? DBALType::TIME : Types::TIME_MUTABLE: + // no break case 'date_immutable': case 'datetime_immutable': case 'datetimetz_immutable': @@ -263,7 +278,9 @@ private function getPhpType($doctrineType) return Type::BUILTIN_TYPE_OBJECT; case self::$useDeprecatedConstants ? DBALType::TARRAY : 'array': + // no break case self::$useDeprecatedConstants ? DBALType::SIMPLE_ARRAY : Types::SIMPLE_ARRAY: + // no break case 'json_array': return Type::BUILTIN_TYPE_ARRAY; }