1 | <?php |
||
18 | class Starter extends Nette\Object |
||
19 | { |
||
20 | |||
21 | const API_DOCU_STARTER_QUERY_KEY_TARGET = '__apiDocu'; |
||
22 | const API_DOCU_STARTER_QUERY_KEY_GENERATE = '__apiDocuGenerate'; |
||
23 | |||
24 | /** |
||
25 | * @var Generator |
||
26 | */ |
||
27 | private $generator; |
||
28 | |||
29 | /** |
||
30 | * @var IRouter |
||
31 | */ |
||
32 | private $router; |
||
33 | |||
34 | /** |
||
35 | * @var Http\Response |
||
36 | */ |
||
37 | private $response; |
||
38 | |||
39 | /** |
||
40 | * @var Http\Request |
||
41 | */ |
||
42 | private $httpRequest; |
||
43 | |||
44 | |||
45 | /** |
||
46 | * @param Generator $generator |
||
47 | * @param IRouter $router |
||
48 | * @param Http\Response $response |
||
49 | * @param Http\Request $httpRequest |
||
50 | */ |
||
51 | public function __construct( |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Event thatis firex when particular ApiRoute is matched |
||
71 | * @param ApiRoute $route |
||
72 | * @param Request $request |
||
73 | * @return void |
||
74 | */ |
||
75 | public function routeMatched(ApiRoute $route, Request $request) |
||
89 | |||
90 | |||
91 | /** |
||
92 | * Find ApiRoutes and add listener to each ApiRoute::onMatch event |
||
93 | * @return void |
||
94 | */ |
||
95 | protected function attachEvents() |
||
103 | |||
104 | } |
||
105 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.