Total Complexity | 6 |
Total Lines | 91 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class RouteMatcher { |
||
9 | /** |
||
10 | * 匹配的URI |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $uri; |
||
15 | /** |
||
16 | * 匹配的方法 |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $methods; |
||
21 | /** |
||
22 | * 属性 |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $attribute; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Get 属性 |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | public function getAttribute() |
||
35 | { |
||
36 | return $this->attribute; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Set 属性 |
||
41 | * |
||
42 | * @param array $attribute 属性 |
||
43 | * |
||
44 | * @return self |
||
45 | */ |
||
46 | public function setAttribute(array $attribute) |
||
47 | { |
||
48 | $this->attribute = $attribute; |
||
49 | |||
50 | return $this; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Get 匹配的方法 |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getMethods() |
||
59 | { |
||
60 | return $this->methods; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Set 匹配的方法 |
||
65 | * |
||
66 | * @param string $methods 匹配的方法 |
||
67 | * |
||
68 | * @return self |
||
69 | */ |
||
70 | public function setMethods(string $methods) |
||
71 | { |
||
72 | $this->methods = $methods; |
||
73 | |||
74 | return $this; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Get 匹配的URI |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getUri() |
||
83 | { |
||
84 | return $this->uri; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Set 匹配的URI |
||
89 | * |
||
90 | * @param string $uri 匹配的URI |
||
91 | * |
||
92 | * @return self |
||
93 | */ |
||
94 | public function setUri(string $uri) |
||
99 | } |
||
100 | } |