Completed
Push — master ( d62d29...27939e )
by Marko
02:28
created

DatagridValuesReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDatagridValues() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Reader;
6
7
use KunicMarko\SonataAnnotationBundle\Annotation\DatagridValues;
8
9
/**
10
 * @author Marko Kunic <[email protected]>
11
 */
12
class DatagridValuesReader
13
{
14
    use AnnotationReaderTrait;
15
16
    public function getDatagridValues(\ReflectionClass $class): array
17
    {
18
        if ($annotation = $this->getClassAnnotation($class, DatagridValues::class)) {
19
            return $annotation->values;
0 ignored issues
show
Bug introduced by
Accessing values on the interface KunicMarko\SonataAnnotat...ion\AnnotationInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
20
        }
21
22
        return [];
23
    }
24
}
25