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

Route   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A shouldAddRoute() 0 3 1
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