Passed
Push — develop ( b8535a...b19a66 )
by Mathieu
11:29
created

DatagridReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAdminAnnotationFields() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Neimheadh\SonataAnnotationBundle\Reader;
6
7
use Doctrine\Common\Annotations\Reader;
8
use Neimheadh\SonataAnnotationBundle\Annotation\Sonata\Admin;
9
use Neimheadh\SonataAnnotationBundle\Annotation\Sonata\DatagridField;
10
11
/**
12
 * Datagrid configuration reader.
13
 *
14
 * @author Marko Kunic <[email protected]>
15
 * @author Mathieu Wambre <[email protected]>
16
 */
17
final class DatagridReader extends AbstractFieldConfigurationReader
18
{
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function __construct(
24
        Reader $annotationReader
25
    ) {
26
        parent::__construct($annotationReader, DatagridField::class);
27
    }
28
29
    /**
30
     * {@inheritDoc}
31
     */
32
    protected function getAdminAnnotationFields(
33
        Admin $annotation,
34
        ?string $action
35
    ): array {
36
        return $annotation->getDatagridFields();
37
    }
38
39
}
40