Passed
Push — develop ( 355f63...51016a )
by Mathieu
02:23
created

AbstractAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Neimheadh\SonataAnnotationBundle\Annotation;
6
7
use ReflectionException;
8
9
/**
10
 * Action annotations main class.
11
 *
12
 * @author Marko Kunic <[email protected]>
13
 * @author Mathieu Wambre <[email protected]>
14
 */
15
abstract class AbstractAction extends AbstractAnnotation
16
{
17
18
    /**
19
     * Action template.
20
     *
21
     * @var string|null
22
     */
23
    public ?string $template = null;
24
25
    /**
26
     * @param string|array|null $template Action template or annotation
27
     *                                    parameters.
28
     *
29
     * @throws ReflectionException
30
     */
31
    public function __construct(
32
        $template = null
33
    ) {
34
        if (is_array($template)) {
35
            $this->initAnnotation($template);
36
        } else {
37
            $this->template = $template;
38
        }
39
    }
40
41
}
42