• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

overblog / GraphQLBundle / 21452238007

28 Jan 2026 07:19PM UTC coverage: 98.546% (-0.02%) from 98.563%
21452238007

push

github

web-flow
adding symfony8 to supported list (#1228)

* adding symfony8 to supported list

* one more exclude, monolog bump

* bump doctrine

* doctrine annotations also

* Revert "doctrine annotations also"

This reverts commit aa26b8191.

* annotations 2.0 once more

* opt-out from annotation if doctrine/orm >= 3

* fix: bridge

* eliminate phpstan concenrns

* trying to make validation tests pass

* Revert "trying to make validation tests pass"

This reverts commit 2553168d1.

* do not skip tests

* Revert "do not skip tests"

This reverts commit d100da0c3.

* monolog bump

* Revert "Revert "trying to make validation tests pass""

This reverts commit b987e43b9.

* Revert "Revert "Revert "trying to make validation tests pass"""

This reverts commit ef4fb3a3a.

* works for php8.4, sf8

* cq

* cleanup

* proper order is now, hmmm ...

* reduce tests scope

remove choice validation from tests as it was not consistent with other
validators in version symfony/validator:7.3.*

* cq

* exclude phps prior to 8.4 from testing with sf8

* apply sorting on responses before comparing

no need to expect same

* do not test sf7 with 8.1

* exclude 7.2 lowest deps as issue with sorting in tests

* sf8 one more exclude

* fix CI config

* handle parameters by name

* revert index.md

* fix cs and cleanup

* collect coverage information from 2 jobs

* fix cs

---------

Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com>

16 of 18 new or added lines in 2 files covered. (88.89%)

53 existing lines in 9 files now uncovered.

4541 of 4608 relevant lines covered (98.55%)

76.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/src/Config/Parser/AnnotationParser.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Overblog\GraphQLBundle\Config\Parser;
6

7
use Doctrine\Common\Annotations\AnnotationReader;
8
use Doctrine\Common\Annotations\AnnotationRegistry;
9
use Doctrine\Common\Annotations\PsrCachedReader;
10
use Doctrine\Common\Annotations\Reader;
11
use Overblog\GraphQLBundle\Config\Parser\MetadataParser\MetadataParser;
12
use ReflectionClass;
13
use ReflectionMethod;
14
use ReflectionProperty;
15
use Reflector;
16
use Symfony\Component\Cache\Adapter\ApcuAdapter;
17
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
18
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
19

20
final class AnnotationParser extends MetadataParser
21
{
22
    public const METADATA_FORMAT = '@%s';
23

24
    protected static Reader $annotationReader;
25

26
    protected static function getMetadatas(Reflector $reflector): array
27
    {
28
        $reader = self::getAnnotationReader();
51✔
29

30
        switch (true) {
31
            case $reflector instanceof ReflectionClass: return $reader->getClassAnnotations($reflector);
51✔
32
            case $reflector instanceof ReflectionMethod: return $reader->getMethodAnnotations($reflector);
49✔
33
            case $reflector instanceof ReflectionProperty: return $reader->getPropertyAnnotations($reflector);
49✔
34
        }
35

36
        return [];
49✔
37
    }
38

39
    public static function getAnnotationReader(): Reader
40
    {
41
        if (!isset(self::$annotationReader)) {
79✔
42
            if (!class_exists(AnnotationReader::class)) {
2✔
43
                throw new ServiceNotFoundException("In order to use annotations, you need to install 'doctrine/annotations' first. See: 'https://www.doctrine-project.org/projects/annotations.html'");
×
44
            }
45
            if (!class_exists(ApcuAdapter::class)) {
2✔
46
                throw new ServiceNotFoundException("In order to use annotations, you need to install 'symfony/cache' first. See: 'https://symfony.com/doc/current/components/cache.html'");
×
47
            }
48

49
            if (class_exists(AnnotationRegistry::class) && method_exists(AnnotationRegistry::class, 'registerLoader')) {
2✔
UNCOV
50
                AnnotationRegistry::registerLoader('class_exists');
1✔
51
            }
52
            $cacheKey = md5(__DIR__);
2✔
53
            // @codeCoverageIgnoreStart
54
            if (extension_loaded('apcu') && apcu_enabled()) {
55
                $annotationCache = new ApcuAdapter($cacheKey);
56
            } else {
57
                $annotationCache = new PhpFilesAdapter($cacheKey);
58
            }
59
            // @codeCoverageIgnoreEnd
60

61
            self::$annotationReader = new PsrCachedReader(new AnnotationReader(), $annotationCache, true);
2✔
62
        }
63

64
        return self::$annotationReader;
79✔
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc