Passed
Pull Request — 1.x (#35)
by Marko
05:54
created

Tab   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getName() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle\Annotation;
6
7
/**
8
 * @Annotation
9
 * @Target("CLASS")
10
 *
11
 * @author Marko Kunic <[email protected]>
12
 */
13
final class Tab implements AnnotationInterface
14
{
15
16
    /**
17
     * @var string
18
     */
19
    public $name;
20
21
    /**
22
     * @var array
23
     */
24
    public $options = [];
25
26
    /**
27
     * @var integer
28
     */
29
    public $position;
30
31
    public function getName(): string
32
    {
33
        if ($this->name) {
34
            return $this->name;
35
        }
36
37
        throw new \InvalidArgumentException(
38
            sprintf(
39
                'Argument "name" is mandatory in "%s" annotation.',
40
                self::class
41
            )
42
        );
43
    }
44
}
45