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

DatagridValuesReader::getDatagridValues()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
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