@@ -22,24 +22,24 @@ discard block |
||
22 | 22 | $this->redirector = $redirector; |
23 | 23 | } |
24 | 24 | |
25 | - public function make(string $content = '', int $status = Response::HTTP_OK, array $headers = []): Response |
|
25 | + public function make(string $content = '', int $status = Response::HTTP_OK, array $headers = [ ]): Response |
|
26 | 26 | { |
27 | 27 | return new Response($content, $status, $headers); |
28 | 28 | } |
29 | 29 | |
30 | - public function noContent(int $status = Response::HTTP_NO_CONTENT, array $headers = []): Response |
|
30 | + public function noContent(int $status = Response::HTTP_NO_CONTENT, array $headers = [ ]): Response |
|
31 | 31 | { |
32 | 32 | return $this->make('', $status, $headers); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function json( |
36 | - array $data = [], |
|
36 | + array $data = [ ], |
|
37 | 37 | int $status = Response::HTTP_OK, |
38 | - array $headers = [], |
|
38 | + array $headers = [ ], |
|
39 | 39 | int $options = 0 |
40 | 40 | ): JsonResponse { |
41 | - if (! array_key_exists('data', $data)) { |
|
42 | - $data = ['data' => $data]; |
|
41 | + if (!array_key_exists('data', $data)) { |
|
42 | + $data = [ 'data' => $data ]; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return new JsonResponse($data, $status, $headers, $options); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public function paginator( |
49 | 49 | LengthAwarePaginator $paginator, |
50 | 50 | int $status = Response::HTTP_OK, |
51 | - array $headers = [], |
|
51 | + array $headers = [ ], |
|
52 | 52 | int $options = 0 |
53 | 53 | ): JsonResponse { |
54 | 54 | return $this->json([ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | LengthAwarePaginator $paginator, |
69 | 69 | callable $map, |
70 | 70 | int $status = Response::HTTP_OK, |
71 | - array $headers = [], |
|
71 | + array $headers = [ ], |
|
72 | 72 | int $options = 0 |
73 | 73 | ): JsonResponse { |
74 | 74 | $paginator->setCollection($paginator->getCollection()->map($map)); |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | return $this->paginator($paginator, $status, $headers, $options); |
77 | 77 | } |
78 | 78 | |
79 | - public function stream(callable $callback, int $status = Response::HTTP_OK, array $headers = []): StreamedResponse |
|
79 | + public function stream(callable $callback, int $status = Response::HTTP_OK, array $headers = [ ]): StreamedResponse |
|
80 | 80 | { |
81 | 81 | return new StreamedResponse($callback, $status, $headers); |
82 | 82 | } |
83 | 83 | |
84 | - public function redirectTo(string $path, int $status = Response::HTTP_FOUND, array $headers = []): RedirectResponse |
|
84 | + public function redirectTo(string $path, int $status = Response::HTTP_FOUND, array $headers = [ ]): RedirectResponse |
|
85 | 85 | { |
86 | 86 | return $this->redirector->to($path, $status, $headers, true); |
87 | 87 | } |