File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1212namespace Symfony \Bridge \Doctrine \DependencyInjection \CompilerPass ;
1313
1414use Symfony \Bridge \Doctrine \Types \DatePointType ;
15+ use Symfony \Component \Clock \DatePoint ;
1516use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
1617use Symfony \Component \DependencyInjection \ContainerBuilder ;
1718
1819final class RegisterDatePointTypePass implements CompilerPassInterface
1920{
2021 public function process (ContainerBuilder $ container ): void
2122 {
23+ if (!class_exists (DatePoint::class)) {
24+ return ;
25+ }
26+
2227 if (!$ container ->hasParameter ('doctrine.dbal.connection_factory.types ' )) {
2328 return ;
2429 }
2530
26- $ name = DatePointType::NAME ;
2731 $ typeDefinition = $ container ->getParameter ('doctrine.dbal.connection_factory.types ' );
2832
29- if (!isset ($ typeDefinition [$ name ])) {
30- $ typeDefinition [$ name ] = ['class ' => DatePointType::class];
33+ if (!isset ($ typeDefinition [' date_point ' ])) {
34+ $ typeDefinition [' date_point ' ] = ['class ' => DatePointType::class];
3135 }
3236
3337 $ container ->setParameter ('doctrine.dbal.connection_factory.types ' , $ typeDefinition );
You can’t perform that action at this time.
0 commit comments