Completed
Push — master ( d62d29...27939e )
by Marko
02:28
created

Route::shouldAddRoute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 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