1 | <?php |
||
27 | class MainController |
||
28 | { |
||
29 | /** |
||
30 | * @var Router |
||
31 | */ |
||
32 | private $router; |
||
33 | |||
34 | /** |
||
35 | * @var Response |
||
36 | */ |
||
37 | private $response; |
||
38 | |||
39 | /** |
||
40 | * @var RestUtilsInterface |
||
41 | */ |
||
42 | private $restUtils; |
||
43 | |||
44 | /** |
||
45 | * @var EngineInterface |
||
46 | */ |
||
47 | private $templating; |
||
48 | |||
49 | /** |
||
50 | * @var EventDispatcherInterface |
||
51 | */ |
||
52 | private $eventDispatcher; |
||
53 | |||
54 | /** |
||
55 | * @var ApiDefinitionLoader |
||
56 | */ |
||
57 | private $apiLoader; |
||
58 | |||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | private $addditionalRoutes; |
||
63 | |||
64 | /** |
||
65 | * @var array |
||
66 | */ |
||
67 | private $pathWhitelist; |
||
68 | |||
69 | /** |
||
70 | * @var array |
||
71 | */ |
||
72 | private $proxySourceConfiguration; |
||
73 | |||
74 | /** |
||
75 | * @param Router $router router |
||
76 | * @param Response $response prepared response |
||
77 | * @param RestUtilsInterface $restUtils rest-utils from GravitonRestBundle |
||
78 | * @param EngineInterface $templating templating-engine |
||
79 | * @param EventDispatcherInterface $eventDispatcher event dispatcher |
||
80 | * @param ApiDefinitionLoader $apiLoader loader for third party api definition |
||
81 | * @param array $additionalRoutes custom routes |
||
82 | * @param array $pathWhitelist serviec path that always get aded to the main page |
||
83 | * @param array $proxySourceConfiguration Set of sources to be recognized by the controller |
||
84 | */ |
||
85 | public function __construct( |
||
106 | |||
107 | /** |
||
108 | * create simple start page. |
||
109 | * |
||
110 | * @return Response $response Response with result or error |
||
111 | */ |
||
112 | public function indexAction() |
||
137 | |||
138 | /** |
||
139 | * Renders a view. |
||
140 | * |
||
141 | * @param string $view The view name |
||
142 | * @param array $parameters An array of parameters to pass to the view |
||
143 | * @param Response $response A response instance |
||
|
|||
144 | * |
||
145 | * @return Response A Response instance |
||
146 | */ |
||
147 | public function render($view, array $parameters = array(), Response $response = null) |
||
151 | |||
152 | /** |
||
153 | * Determines what service endpoints are available. |
||
154 | * |
||
155 | * @param array $optionRoutes List of routing options. |
||
156 | * |
||
157 | * @return array |
||
158 | */ |
||
159 | protected function determineServices(array $optionRoutes) |
||
200 | |||
201 | /** |
||
202 | * gets the additional routes that can be injected by listeners/subscribers |
||
203 | * |
||
204 | * @param array $sortArr array needed for sorting |
||
205 | * |
||
206 | * @return array additional routes |
||
207 | */ |
||
208 | private function getAdditionalRoutes(array &$sortArr) |
||
229 | |||
230 | /** |
||
231 | * Prepares the header field containing information about pagination. |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | protected function prepareLinkHeader() |
||
247 | |||
248 | /** |
||
249 | * tells if a service is relevant for the mainpage |
||
250 | * |
||
251 | * @param array $val value of service spec |
||
252 | * |
||
253 | * @return boolean |
||
254 | */ |
||
255 | private function isRelevantForMainPage($val) |
||
260 | |||
261 | /** |
||
262 | * Resolves all third party routes and add schema info |
||
263 | * |
||
264 | * @param array $thirdApiRoutes list of all routes from an API |
||
265 | * |
||
266 | * @return array |
||
267 | */ |
||
268 | protected function determineThirdPartyServices(array $thirdApiRoutes) |
||
289 | |||
290 | /** |
||
291 | * Finds configured external apis to be exposed via G2. |
||
292 | * |
||
293 | * @return array |
||
294 | */ |
||
295 | private function registerThirdPartyServices() |
||
315 | |||
316 | /** |
||
317 | * get API name and endpoint from the url (third party API) |
||
318 | * |
||
319 | * @param array $config Configuration information ['prefix', 'serviceEndpoint'] |
||
320 | * |
||
321 | * @return array |
||
322 | */ |
||
323 | protected function decideApiAndEndpoint(array $config) |
||
334 | |||
335 | /** |
||
336 | * Return OPTIONS results. |
||
337 | * |
||
338 | * @param Request $request Current http request |
||
339 | * |
||
340 | * @return Response $response Result of the action |
||
341 | */ |
||
342 | public function optionsAction(Request $request) |
||
350 | } |
||
351 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.