@@ -73,7 +73,7 @@ protected function get(string $id)
73
73
*
74
74
* @final
75
75
*/
76
- protected function generateUrl (string $ route , array $ parameters = array () , int $ referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ): string
76
+ protected function generateUrl (string $ route , array $ parameters = [] , int $ referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ): string
77
77
{
78
78
return $ this ->container ->get ('router ' )->generate ($ route , $ parameters , $ referenceType );
79
79
}
@@ -85,7 +85,7 @@ protected function generateUrl(string $route, array $parameters = array(), int $
85
85
*
86
86
* @final
87
87
*/
88
- protected function forward (string $ controller , array $ path = array () , array $ query = array () ): Response
88
+ protected function forward (string $ controller , array $ path = [] , array $ query = [] ): Response
89
89
{
90
90
$ request = $ this ->container ->get ('request_stack ' )->getCurrentRequest ();
91
91
$ path ['_controller ' ] = $ controller ;
@@ -109,7 +109,7 @@ protected function redirect(string $url, int $status = 302): RedirectResponse
109
109
*
110
110
* @final
111
111
*/
112
- protected function redirectToRoute (string $ route , array $ parameters = array () , int $ status = 302 ): RedirectResponse
112
+ protected function redirectToRoute (string $ route , array $ parameters = [] , int $ status = 302 ): RedirectResponse
113
113
{
114
114
return $ this ->redirect ($ this ->generateUrl ($ route , $ parameters ), $ status );
115
115
}
@@ -119,12 +119,12 @@ protected function redirectToRoute(string $route, array $parameters = array(), i
119
119
*
120
120
* @final
121
121
*/
122
- protected function json ($ data , int $ status = 200 , array $ headers = array () , array $ context = array () ): JsonResponse
122
+ protected function json ($ data , int $ status = 200 , array $ headers = [] , array $ context = [] ): JsonResponse
123
123
{
124
124
if ($ this ->container ->has ('serializer ' )) {
125
- $ json = $ this ->container ->get ('serializer ' )->serialize ($ data , 'json ' , array_merge (array (
125
+ $ json = $ this ->container ->get ('serializer ' )->serialize ($ data , 'json ' , array_merge ([
126
126
'json_encode_options ' => JsonResponse::DEFAULT_ENCODING_OPTIONS ,
127
- ) , $ context ));
127
+ ] , $ context ));
128
128
129
129
return new JsonResponse ($ json , $ status , $ headers , true );
130
130
}
@@ -203,7 +203,7 @@ protected function denyAccessUnlessGranted($attributes, $subject = null, string
203
203
*
204
204
* @final
205
205
*/
206
- protected function renderView (string $ view , array $ parameters = array () ): string
206
+ protected function renderView (string $ view , array $ parameters = [] ): string
207
207
{
208
208
if ($ this ->container ->has ('templating ' )) {
209
209
return $ this ->container ->get ('templating ' )->render ($ view , $ parameters );
@@ -221,7 +221,7 @@ protected function renderView(string $view, array $parameters = array()): string
221
221
*
222
222
* @final
223
223
*/
224
- protected function render (string $ view , array $ parameters = array () , Response $ response = null ): Response
224
+ protected function render (string $ view , array $ parameters = [] , Response $ response = null ): Response
225
225
{
226
226
if ($ this ->container ->has ('templating ' )) {
227
227
$ content = $ this ->container ->get ('templating ' )->render ($ view , $ parameters );
@@ -245,7 +245,7 @@ protected function render(string $view, array $parameters = array(), Response $r
245
245
*
246
246
* @final
247
247
*/
248
- protected function stream (string $ view , array $ parameters = array () , StreamedResponse $ response = null ): StreamedResponse
248
+ protected function stream (string $ view , array $ parameters = [] , StreamedResponse $ response = null ): StreamedResponse
249
249
{
250
250
if ($ this ->container ->has ('templating ' )) {
251
251
$ templating = $ this ->container ->get ('templating ' );
@@ -311,7 +311,7 @@ protected function createAccessDeniedException(string $message = 'Access Denied.
311
311
*
312
312
* @final
313
313
*/
314
- protected function createForm (string $ type , $ data = null , array $ options = array () ): FormInterface
314
+ protected function createForm (string $ type , $ data = null , array $ options = [] ): FormInterface
315
315
{
316
316
return $ this ->container ->get ('form.factory ' )->create ($ type , $ data , $ options );
317
317
}
@@ -321,7 +321,7 @@ protected function createForm(string $type, $data = null, array $options = array
321
321
*
322
322
* @final
323
323
*/
324
- protected function createFormBuilder ($ data = null , array $ options = array () ): FormBuilderInterface
324
+ protected function createFormBuilder ($ data = null , array $ options = [] ): FormBuilderInterface
325
325
{
326
326
return $ this ->container ->get ('form.factory ' )->createBuilder (FormType::class, $ data , $ options );
327
327
}
@@ -419,7 +419,7 @@ protected function addLink(Request $request, Link $link)
419
419
}
420
420
421
421
if (null === $ linkProvider = $ request ->attributes ->get ('_links ' )) {
422
- $ request ->attributes ->set ('_links ' , new GenericLinkProvider (array ( $ link) ));
422
+ $ request ->attributes ->set ('_links ' , new GenericLinkProvider ([ $ link] ));
423
423
424
424
return ;
425
425
}
0 commit comments