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) |
||
197 | |||
198 | /** |
||
199 | * gets the additional routes that can be injected by listeners/subscribers |
||
200 | * |
||
201 | * @param array $sortArr array needed for sorting |
||
202 | * |
||
203 | * @return array additional routes |
||
204 | */ |
||
205 | private function getAdditionalRoutes(array &$sortArr) |
||
226 | |||
227 | /** |
||
228 | * Prepares the header field containing information about pagination. |
||
229 | * |
||
230 | * @return string |
||
231 | */ |
||
232 | protected function prepareLinkHeader() |
||
244 | |||
245 | /** |
||
246 | * tells if a service is relevant for the mainpage |
||
247 | * |
||
248 | * @param array $val value of service spec |
||
249 | * |
||
250 | * @return boolean |
||
251 | */ |
||
252 | private function isRelevantForMainPage($val) |
||
259 | |||
260 | /** |
||
261 | * Resolves all third party routes and add schema info |
||
262 | * |
||
263 | * @param array $thirdApiRoutes list of all routes from an API |
||
264 | * |
||
265 | * @return array |
||
266 | */ |
||
267 | protected function determineThirdPartyServices(array $thirdApiRoutes) |
||
288 | |||
289 | /** |
||
290 | * Finds configured external apis to be exposed via G2. |
||
291 | * |
||
292 | * @return array |
||
293 | */ |
||
294 | private function registerThirdPartyServices() |
||
314 | |||
315 | /** |
||
316 | * get API name and endpoint from the url (third party API) |
||
317 | * |
||
318 | * @param array $config Configuration information ['prefix', 'serviceEndpoint'] |
||
319 | * |
||
320 | * @return array |
||
321 | */ |
||
322 | protected function decideApiAndEndpoint(array $config) |
||
333 | |||
334 | /** |
||
335 | * Return OPTIONS results. |
||
336 | * |
||
337 | * @param Request $request Current http request |
||
338 | * |
||
339 | * @return Response $response Result of the action |
||
340 | */ |
||
341 | public function optionsAction(Request $request) |
||
349 | } |
||
350 |
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.