Passed
Push — master ( 4c80ea...de511c )
by Rustam
01:28
created

Controller::getMiddlewares()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiistack\Routing\Annotation;
6
7
use Doctrine\Common\Annotations\Annotation\Target;
8
9
/**
10
 * @Annotation
11
 * @Target("CLASS")
12
 */
13
final class Controller
14
{
15
    private string $route;
16
    private array $middlewares;
17
18
    public function __construct(array $values)
19
    {
20
        if (isset($values['value'])) {
21
            $this->route = $values['value'];
22
        }
23
        if (isset($values['middlewares'])) {
24
            $this->middlewares = $values['middlewares'];
25
        }
26
    }
27
28
    public function getRoute(): string
29
    {
30
        return $this->route;
31
    }
32
33
    public function getMiddlewares(): array
34
    {
35
        return $this->middlewares;
36
    }
37
}
38