Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bc2753

Browse files
committed
feature #26073 [DoctrineBridge] Add support for datetime immutable types in doctrine type guesser (jvasseur)
This PR was merged into the 4.1-dev branch. Discussion ---------- [DoctrineBridge] Add support for datetime immutable types in doctrine type guesser | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Add support for datetime immutable types in doctrine type guesser now that we support `DateTimeImmutable` input in the form component. Commits ------- 8c94fef Add support for immutable types in doctrine type guesser
2 parents d418395 + 8c94fef commit 5bc2753

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Symfony/Bridge/Doctrine/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.1.0
5+
-----
6+
7+
* added support for datetime immutable types in form type guesser
8+
49
4.0.0
510
-----
611

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,19 @@ public function guessType($class, $property)
6060
case Type::DATETIMETZ:
6161
case 'vardatetime':
6262
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', array(), Guess::HIGH_CONFIDENCE);
63+
case 'datetime_immutable';
64+
case 'datetimetz_immutable';
65+
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', array('input' => 'datetime_immutable'), Guess::HIGH_CONFIDENCE);
6366
case 'dateinterval':
6467
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateIntervalType', array(), Guess::HIGH_CONFIDENCE);
6568
case Type::DATE:
6669
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateType', array(), Guess::HIGH_CONFIDENCE);
70+
case 'date_immutable':
71+
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateType', array('input' => 'datetime_immutable'), Guess::HIGH_CONFIDENCE);
6772
case Type::TIME:
6873
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', array(), Guess::HIGH_CONFIDENCE);
74+
case 'time_immutable'
75+
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TimeType', array('input' => 'datetime_immutable'), Guess::HIGH_CONFIDENCE);
6976
case Type::DECIMAL:
7077
case Type::FLOAT:
7178
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\NumberType', array(), Guess::MEDIUM_CONFIDENCE);

0 commit comments

Comments
 (0)