Skip to content

Commit ab0f1ad

Browse files
authored
Merge pull request #34 from alexander-schranz/enhancement/autoload-doctrine-annotations
Fix Symfony 6.3 compatibility by use autoloading for doctrine annotations
2 parents f41f2f3 + 6056a04 commit ab0f1ad

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

Mapping/DocumentParser.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public function __construct(Reader $reader, DocumentFinder $finder)
7878
{
7979
$this->reader = $reader;
8080
$this->finder = $finder;
81-
$this->registerAnnotations();
8281
}
8382

8483
/**
@@ -389,33 +388,6 @@ private function getMutatorMethods(\ReflectionClass $reflectionClass, $property,
389388
throw new \LogicException($message);
390389
}
391390

392-
/**
393-
* Registers annotations to registry so that it could be used by reader.
394-
*/
395-
private function registerAnnotations()
396-
{
397-
$annotations = [
398-
'Document',
399-
'Property',
400-
'Embedded',
401-
'ObjectType',
402-
'Nested',
403-
'Id',
404-
'ParentDocument',
405-
'Routing',
406-
'Version',
407-
'HashMap',
408-
];
409-
410-
foreach ($annotations as $annotation) {
411-
AnnotationRegistry::registerFile(__DIR__ . "/../Annotation/{$annotation}.php");
412-
}
413-
414-
if (version_compare(PHP_VERSION, '7.2.0') < 0) {
415-
AnnotationRegistry::registerFile(__DIR__ . "/../Annotation/Object.php");
416-
}
417-
}
418-
419391
/**
420392
* Returns document type.
421393
*

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/stopwatch": "^2.8|^3.0|^4|^5|^6",
2222
"symfony/templating": "^2.8|^3.0|^4|^5|^6",
2323
"symfony/asset": "^2.8|^3.0|^4|^5|^6",
24-
"doctrine/annotations": "~1.2",
24+
"doctrine/annotations": "^1.10",
2525
"doctrine/inflector": "^1.0 || ^2.0",
2626
"doctrine/cache": "~1.4",
2727
"doctrine/collections": "~1.4",

0 commit comments

Comments
 (0)