Skip to content

Commit

Permalink
Annotations: support doctrine/annotations v1
Browse files Browse the repository at this point in the history
  • Loading branch information
radimvaculik committed Mar 14, 2024
1 parent 33ec0d4 commit 7095850
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Core/DI/LoaderFactory/DualReaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Apitte\Core\DI\LoaderFactory;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\Reader;
use Koriym\Attributes\AttributeReader;
use Koriym\Attributes\DualReader;
Expand All @@ -16,6 +17,9 @@ class DualReaderFactory
public function create(): Reader
{
$annotationReader = new AnnotationReader();
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {

Check failure on line 20 in src/Core/DI/LoaderFactory/DualReaderFactory.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.2)

Expected 1 line after "if", found 0.

Check failure on line 20 in src/Core/DI/LoaderFactory/DualReaderFactory.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.2)

Call to function method_exists() with 'Doctrine\\Common\\Annotations\\AnnotationRegistry' and 'registerUniqueLoader' will always evaluate to false.
AnnotationRegistry::registerUniqueLoader('class_exists');

Check warning on line 21 in src/Core/DI/LoaderFactory/DualReaderFactory.php

View check run for this annotation

Codecov / codecov/patch

src/Core/DI/LoaderFactory/DualReaderFactory.php#L21

Added line #L21 was not covered by tests
}
$attributeReader = new AttributeReader();

return new DualReader($annotationReader, $attributeReader);
Expand Down

0 comments on commit 7095850

Please sign in to comment.