Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9d2acf

Browse filesBrowse files
committed
add check to pass
1 parent 08c0c34 commit d9d2acf
Copy full SHA for d9d2acf

File tree

1 file changed

+7
-3
lines changed
Filter options

1 file changed

+7
-3
lines changed

‎src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterDatePointTypePass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterDatePointTypePass.php
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@
1212
namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass;
1313

1414
use Symfony\Bridge\Doctrine\Types\DatePointType;
15+
use Symfony\Component\Clock\DatePoint;
1516
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718

1819
final 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);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.