Route::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
namespace Air\Routing\Route;
4
5
class Route implements RouteInterface
6
{
7
    /**
8
     * @var string $uri The URI.
9
     */
10
    protected $uri;
11
12
13
    /**
14
     * @var string $controller The controller name.
15
     */
16
    protected $controller;
17
18
19
    /**
20
     * @var string $action The controller action name.
21
     */
22
    protected $action;
23
24
25
    /**
26
     * @var string $type The request type.
27
     */
28
    protected $requestType;
29
30
31
    /**
32
     * @param string $uri The URI.
33
     * @param string $controller The controller name.
34
     * @param string $action The controller action name.
35
     * @param string $requestType The request type.
36
     */
37
    public function __construct($uri, $controller, $action, $requestType = 'GET')
38
    {
39
        $this->uri = $uri;
40
        $this->controller = $controller;
41
        $this->action = $action;
42
        $this->requestType = $requestType;
43
    }
44
45
46
    /**
47
     * @return string The URI.
48
     */
49
    public function getUri()
50
    {
51
        return $this->uri;
52
    }
53
54
55
    /**
56
     * @return string The request type.
57
     */
58
    public function getRequestType()
59
    {
60
        return $this->requestType;
61
    }
62
63
64
    /**
65
     * @return string The controller name.
66
     */
67
    public function getController()
68
    {
69
        return $this->controller;
70
    }
71
72
73
    /**
74
     * @return string The controller action name.
75
     */
76
    public function getAction()
77
    {
78
        return $this->action;
79
    }
80
}
81