Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wiring of PHP metadata drivers on doctrine/orm 3.x #1832

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Throw exception if annotation driver is configured with doctrine/orm > 2
  • Loading branch information
MatTheCat committed Nov 4, 2024
commit 0c54ba599f25ee319999baedb74f0cf9d7721fec
4 changes: 4 additions & 0 deletions src/DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,10 @@
return MappingDriverChain::class;

case 'annotation':
if (! class_exists(AnnotationDriver::class)) {
throw new LogicException('The annotation driver is only available in doctrine/orm v2.');
}

return AnnotationDriver::class;
MatTheCat marked this conversation as resolved.
Show resolved Hide resolved

case 'xml':
Expand All @@ -1185,10 +1189,10 @@
return SimplifiedYamlDriver::class;

case 'php':
return class_exists(PHPDriver::class) ? PHPDriver::class : LegacyPHPDriver::class;

Check failure on line 1192 in src/DependencyInjection/DoctrineExtension.php

View workflow job for this annotation

GitHub Actions / Static Analysis with Psalm

UndefinedClass

src/DependencyInjection/DoctrineExtension.php:1192:76: UndefinedClass: Class, interface or enum named Doctrine\ORM\Mapping\Driver\PHPDriver does not exist (see https://psalm.dev/019)

case 'staticphp':
return class_exists(StaticPHPDriver::class) ? StaticPHPDriver::class : LegacyStaticPHPDriver::class;

Check failure on line 1195 in src/DependencyInjection/DoctrineExtension.php

View workflow job for this annotation

GitHub Actions / Static Analysis with Psalm

UndefinedClass

src/DependencyInjection/DoctrineExtension.php:1195:88: UndefinedClass: Class, interface or enum named Doctrine\ORM\Mapping\Driver\StaticPHPDriver does not exist (see https://psalm.dev/019)

case 'attribute':
return AttributeDriver::class;
Expand Down
Loading