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

ShowReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAdminAnnotationFields() 0 5 1
A __construct() 0 3 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\ShowField;
10
11
/**
12
 * Show configuration reader.
13
 *
14
 * @author Marko Kunic <[email protected]>
15
 * @author Mathieu Wambre <[email protected]>
16
 */
17
final class ShowReader extends AbstractFieldConfigurationReader
18
{
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function __construct(Reader $annotationReader)
24
    {
25
        parent::__construct($annotationReader, ShowField::class);
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    protected function getAdminAnnotationFields(
32
        Admin $annotation,
33
        ?string $action
34
    ): array {
35
        return $annotation->getShowFields();
36
    }
37
38
}
39