Completed
Push — 1.x ( aadfa3...ac39bc )
by Marko
02:25
created

AbstractAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTemplate() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Annotation;
6
7
/**
8
 * @author Marko Kunic <[email protected]>
9
 */
10
abstract class AbstractAction implements AnnotationInterface
11
{
12
    /**
13
     * @var string
14
     */
15
    public $template;
16
17
    public function getTemplate(): string
18
    {
19
        if ($this->template) {
20
            return $this->template;
21
        }
22
23
        throw new \InvalidArgumentException(
24
            sprintf(
25
                'Argument "template" is mandatory in "%s" annotation.',
26
                static::class
27
            )
28
        );
29
    }
30
}
31