1 | <?php |
||
5 | abstract class BaseRouter implements RouterInterface |
||
6 | { |
||
7 | protected $extensions = []; |
||
8 | |||
9 | /** |
||
10 | * Add a custom extension to CLImate |
||
11 | * |
||
12 | * @param string $key |
||
13 | * @param string $class |
||
14 | */ |
||
15 | 28 | public function addExtension($key, $class) |
|
19 | |||
20 | /** |
||
21 | * Get the full path for the class based on the key |
||
22 | * |
||
23 | * @param string $class |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | 580 | public function path($class) |
|
31 | |||
32 | /** |
||
33 | * Determines if the requested class is a |
||
34 | * valid terminal object class |
||
35 | * |
||
36 | * @param string $class |
||
37 | * |
||
38 | * @return boolean |
||
39 | */ |
||
40 | 580 | public function exists($class) |
|
46 | |||
47 | /** |
||
48 | * Get the full path for the terminal object class |
||
49 | * |
||
50 | * @param string $class |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | 564 | protected function getPath($class) |
|
58 | |||
59 | /** |
||
60 | * Get an extension by its key |
||
61 | * |
||
62 | * @param string $key |
||
63 | * |
||
64 | * @return string|false Full class path to extension |
||
65 | */ |
||
66 | 580 | protected function getExtension($key) |
|
74 | |||
75 | /** |
||
76 | * Get the class short name |
||
77 | * |
||
78 | * @param string $name |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | 564 | protected function shortName($name) |
|
89 | } |
||
90 |