AnnotationDriver::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 5
rs 10
ccs 0
cts 0
cp 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Metadata\Driver;
6
7
use Doctrine\Common\Annotations\Reader;
8
use JMS\Serializer\Expression\CompilableExpressionEvaluatorInterface;
9
use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
10
use JMS\Serializer\Type\ParserInterface;
11
12
/**
13
 * @deprecated
14
 */
15
class AnnotationDriver extends AnnotationOrAttributeDriver
16
{
17
    /**
18
     * @var Reader
19
     */
20
    private $reader;
21
22
    public function __construct(Reader $reader, PropertyNamingStrategyInterface $namingStrategy, ?ParserInterface $typeParser = null, ?CompilableExpressionEvaluatorInterface $expressionEvaluator = null)
23
    {
24
        parent::__construct($namingStrategy, $typeParser, $expressionEvaluator, $reader);
25
26
        $this->reader = $reader;
27
    }
28
29
    /**
30
     * @return list<object>
0 ignored issues
show
Bug introduced by
The type JMS\Serializer\Metadata\Driver\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
     */
32
    protected function getClassAnnotations(\ReflectionClass $class): array
33
    {
34
        return $this->reader->getClassAnnotations($class);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->reader->getClassAnnotations($class) returns the type array<mixed,object> which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
35
    }
36
37
    /**
38
     * @return list<object>
39
     */
40
    protected function getMethodAnnotations(\ReflectionMethod $method): array
41
    {
42
        return $this->reader->getMethodAnnotations($method);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->reader->ge...hodAnnotations($method) returns the type array<mixed,object> which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
43
    }
44
45
    /**
46
     * @return list<object>
47
     */
48
    protected function getPropertyAnnotations(\ReflectionProperty $property): array
49
    {
50
        return $this->reader->getPropertyAnnotations($property);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->reader->ge...yAnnotations($property) returns the type array<mixed,object> which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
51
    }
52
}
53