Skip to content

Commit

Permalink
Support doctrine annotations 2.0 (#158)
Browse files Browse the repository at this point in the history
* topic 344  doctrine annotations 2.0

---------

Co-authored-by: a.dmitryuk <[email protected]>
  • Loading branch information
dmitryuk and a.dmitryuk authored Feb 28, 2023
1 parent fd73134 commit a8bd15d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"php": ">=7.4",
"ext-json": "*",
"doctrine/annotations": "^1.8",
"doctrine/annotations": "^1.8|^2.0",
"doctrine/orm": "^2.7",
"symfony/cache": "^4.0|^5.0|^6.0",
"symfony/event-dispatcher": "^4.0|^5.0|^6.0",
Expand Down
5 changes: 4 additions & 1 deletion src/Provider/Doctrine/Persistence/Helper/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ public static function createAttributeMetadataConfiguration(array $paths, bool $
public static function createAnnotationMetadataConfiguration(array $paths, bool $isDevMode = false): Configuration
{
if (class_exists(ORMSetup::class)) {
AnnotationRegistry::registerLoader('class_exists');
// @phpstan-ignore-next-line
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
AnnotationRegistry::registerLoader('class_exists');
}

return ORMSetup::createAnnotationMetadataConfiguration($paths, $isDevMode);
}
Expand Down

0 comments on commit a8bd15d

Please sign in to comment.