3
3
namespace Inertia ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Support \Arr ;
7
+ use Illuminate \Http \Request ;
8
+ use Illuminate \Http \JsonResponse ;
9
+ use Illuminate \Support \Facades \App ;
6
10
use GuzzleHttp \Promise \PromiseInterface ;
11
+ use Illuminate \Support \Traits \Macroable ;
7
12
use Illuminate \Contracts \Support \Arrayable ;
8
13
use Illuminate \Contracts \Support \Responsable ;
9
- use Illuminate \Http \JsonResponse ;
10
- use Illuminate \Http \Request ;
11
14
use Illuminate \Http \Resources \Json \JsonResource ;
12
15
use Illuminate \Http \Resources \Json \ResourceResponse ;
13
- use Illuminate \Support \Arr ;
14
- use Illuminate \Support \Facades \App ;
15
16
use Illuminate \Support \Facades \Response as ResponseFactory ;
16
- use Illuminate \Support \Traits \Macroable ;
17
17
18
18
class Response implements Responsable
19
19
{
@@ -26,10 +26,7 @@ class Response implements Responsable
26
26
protected $ viewData = [];
27
27
28
28
/**
29
- * @param string $component
30
- * @param array|Arrayable $props
31
- * @param string $rootView
32
- * @param string $version
29
+ * @param array|Arrayable $props
33
30
*/
34
31
public function __construct (string $ component , $ props , string $ rootView = 'app ' , string $ version = '' )
35
32
{
@@ -40,8 +37,9 @@ public function __construct(string $component, $props, string $rootView = 'app',
40
37
}
41
38
42
39
/**
43
- * @param string|array $key
44
- * @param mixed|null $value
40
+ * @param string|array $key
41
+ * @param mixed|null $value
42
+ *
45
43
* @return $this
46
44
*/
47
45
public function with ($ key , $ value = null ): self
@@ -56,8 +54,9 @@ public function with($key, $value = null): self
56
54
}
57
55
58
56
/**
59
- * @param string|array $key
60
- * @param mixed|null $value
57
+ * @param string|array $key
58
+ * @param mixed|null $value
59
+ *
61
60
* @return $this
62
61
*/
63
62
public function withViewData ($ key , $ value = null ): self
@@ -81,7 +80,8 @@ public function rootView(string $rootView): self
81
80
/**
82
81
* Create an HTTP response that represents the object.
83
82
*
84
- * @param \Illuminate\Http\Request $request
83
+ * @param \Illuminate\Http\Request $request
84
+ *
85
85
* @return \Symfony\Component\HttpFoundation\Response
86
86
*/
87
87
public function toResponse ($ request )
@@ -112,11 +112,6 @@ public function toResponse($request)
112
112
113
113
/**
114
114
* Resolve all necessary class instances in the given props.
115
- *
116
- * @param array $props
117
- * @param \Illuminate\Http\Request $request
118
- * @param bool $unpackDotProps
119
- * @return array
120
115
*/
121
116
public function resolvePropertyInstances (array $ props , Request $ request , bool $ unpackDotProps = true ): array
122
117
{
0 commit comments