Passed
Push — master ( 12666c...576d22 )
by Asmir
14:13 queued 11:54
created

AttributeDriver::getMethodAnnotations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Metadata\Driver;
6
7
class AttributeDriver extends AnnotationOrAttributeDriver
8
{
9
    /**
10
     * @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...
11
     */
12
    protected function getClassAnnotations(\ReflectionClass $class): array
13
    {
14
        return array_map(
0 ignored issues
show
Bug Best Practice introduced by
The expression return array_map(functio...class->getAttributes()) returns the type array which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
15
            static function (\ReflectionAttribute $attribute): object {
16
                return $attribute->newInstance();
17
            },
18
            $class->getAttributes()
19
        );
20
    }
21
22
    /**
23
     * @return list<object>
24
     */
25
    protected function getMethodAnnotations(\ReflectionMethod $method): array
26
    {
27
        return array_map(
0 ignored issues
show
Bug Best Practice introduced by
The expression return array_map(functio...ethod->getAttributes()) returns the type array which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
28
            static function (\ReflectionAttribute $attribute): object {
29
                return $attribute->newInstance();
30
            },
31
            $method->getAttributes()
32
        );
33
    }
34
35
    /**
36
     * @return list<object>
37
     */
38
    protected function getPropertyAnnotations(\ReflectionProperty $property): array
39
    {
40
        return array_map(
0 ignored issues
show
Bug Best Practice introduced by
The expression return array_map(functio...perty->getAttributes()) returns the type array which is incompatible with the documented return type JMS\Serializer\Metadata\Driver\list.
Loading history...
41
            static function (\ReflectionAttribute $attribute): object {
42
                return $attribute->newInstance();
43
            },
44
            $property->getAttributes()
45
        );
46
    }
47
}
48