ListAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 9
c 1
b 0
f 1
dl 0
loc 22
rs 10

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 ListAction implements AnnotationInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    public $name;
19
20
    /**
21
     * @var array
22
     */
23
    public $options = [];
24
25
    public function getName(): string
26
    {
27
        if ($this->name) {
28
            return $this->name;
29
        }
30
31
        throw new \InvalidArgumentException(
32
            sprintf(
33
                'Argument "name" is mandatory in "%s" annotation.',
34
                self::class
35
            )
36
        );
37
    }
38
}
39