1 | <?php |
||
8 | class Kernel |
||
9 | { |
||
10 | |||
11 | const PATH_CONFIG = '/../config/'; |
||
12 | |||
13 | use \Nymfonya\Component\Http\Reuse\TKernel; |
||
14 | |||
15 | /** |
||
16 | * instanciate |
||
17 | * @return Kernel |
||
|
|||
18 | */ |
||
19 | 26 | public function __construct(string $env, string $path) |
|
20 | { |
||
21 | 26 | $this->init($env, $path); |
|
22 | 26 | return $this; |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * set controller namespace |
||
27 | * |
||
28 | * @param string $ctrlNamespace |
||
29 | * @return Kernel |
||
30 | */ |
||
31 | 26 | public function setNameSpace(string $ctrlNamespace): Kernel |
|
36 | |||
37 | /** |
||
38 | * retrieve kernel instance classname from container |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | public function getBundleClassname():string |
||
46 | |||
47 | /** |
||
48 | * run app |
||
49 | * |
||
50 | * @param array $groups |
||
51 | * @return Kernel |
||
52 | */ |
||
53 | 3 | public function run(array $groups = []): Kernel |
|
74 | |||
75 | /** |
||
76 | * set controller action from router groups |
||
77 | * |
||
78 | * @param array $routerGrps |
||
79 | * @return void |
||
80 | */ |
||
81 | 10 | public function setAction(array $routerGrps) |
|
85 | |||
86 | /** |
||
87 | * dispatch response |
||
88 | * |
||
89 | * @return Kernel |
||
90 | */ |
||
91 | 1 | public function send(): Kernel |
|
113 | |||
114 | /** |
||
115 | * shutdown kernel |
||
116 | * |
||
117 | * @return void |
||
118 | */ |
||
119 | 1 | public function shutdown(int $code = 0) |
|
123 | } |
||
124 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.