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

DatagridReader::getAdminAnnotationFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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