1 | <?php |
||
12 | class ControllerInspector |
||
13 | { |
||
14 | /** |
||
15 | * An array of HTTP verbs. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $verbs = [ |
||
20 | 'any', 'get', 'post', 'put', 'patch', |
||
21 | 'delete', 'head', 'options', |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Get the routable methods for a controller. |
||
26 | * |
||
27 | * @param string $controller |
||
28 | * @param string $prefix |
||
29 | * @return array |
||
30 | */ |
||
31 | public function getRoutable($controller, $prefix) |
||
59 | |||
60 | /** |
||
61 | * Determine if the given controller method is routable. |
||
62 | * |
||
63 | * @param \ReflectionMethod $method |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isRoutable(ReflectionMethod $method) |
||
74 | |||
75 | /** |
||
76 | * Get the method data for a given method. |
||
77 | * |
||
78 | * @param \ReflectionMethod $method |
||
79 | * @param string $prefix |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getMethodData(ReflectionMethod $method, $prefix) |
||
90 | |||
91 | /** |
||
92 | * Get the routable data for an index method. |
||
93 | * |
||
94 | * @param array $data |
||
95 | * @param string $prefix |
||
96 | * @return array |
||
97 | */ |
||
98 | protected function getIndexData($data, $prefix) |
||
102 | |||
103 | /** |
||
104 | * Extract the verb from a controller action. |
||
105 | * |
||
106 | * @param string $name |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getVerb($name) |
||
113 | |||
114 | /** |
||
115 | * Determine the URI from the given method name. |
||
116 | * |
||
117 | * @param string $name |
||
118 | * @param string $prefix |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getPlainUri($name, $prefix) |
||
125 | |||
126 | /** |
||
127 | * Add wildcards to the given URI. |
||
128 | * |
||
129 | * @param string $uri |
||
130 | * @return string |
||
131 | */ |
||
132 | public function addUriWildcards($uri) |
||
136 | } |
||
137 |