Completed
Push — master ( c96bfe...df0c48 )
by Marko
02:29
created

Route::getArgumentsByOption()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace KunicMarko\SonataAnnotationBundle\Annotation;
4
5
/**
6
 * @Annotation
7
 * @Target("CLASS")
8
 *
9
 * @author Marko Kunic <[email protected]>
10
 */
11
class Route
12
{
13
    private const DEFAULT_OPTION = 'add';
14
15
    public $name;
16
    public $path;
17
    public $option = self::DEFAULT_OPTION;
18
19
    public function getArgumentsByOption(): array
20
    {
21
        if ($this->option === self::DEFAULT_OPTION) {
22
            return [$this->name, $this->path];
23
        }
24
25
        return [$this->name];
26
    }
27
}
28