Completed
Push — master ( d62d29...27939e )
by Marko
02:28
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
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
class Route implements AnnotationInterface
14
{
15
    public const ID_PARAMETER = '{id}';
16
    private const DEFAULT_METHOD = 'add';
17
18
    /**
19
     * @var string
20
     */
21
    public $name;
22
23
    /**
24
     * @var string
25
     */
26
    public $path;
27
28
    /**
29
     * @var string
30
     */
31
    public $method = self::DEFAULT_METHOD;
32
33
    public function shouldAddRoute(): bool
34
    {
35
        return $this->method === self::DEFAULT_METHOD;
36
    }
37
}
38