33namespace Inertia ;
44
55use Closure ;
6+ use Illuminate \Support \Arr ;
7+ use Illuminate \Support \Str ;
8+ use Inertia \Support \Header ;
69use Illuminate \Http \Request ;
710use Illuminate \Http \JsonResponse ;
811use Illuminate \Support \Facades \App ;
9- use Illuminate \Support \Str ;
1012use GuzzleHttp \Promise \PromiseInterface ;
1113use Illuminate \Support \Traits \Macroable ;
1214use Illuminate \Contracts \Support \Arrayable ;
1315use Illuminate \Contracts \Support \Responsable ;
1416use Illuminate \Http \Resources \Json \JsonResource ;
1517use Illuminate \Http \Resources \Json \ResourceResponse ;
16- use Illuminate \Support \Arr ;
1718use Illuminate \Support \Facades \Response as ResponseFactory ;
18- use Inertia \Support \Header ;
1919
2020class Response implements Responsable
2121{
@@ -40,7 +40,6 @@ public function __construct(string $component, array $props, string $rootView =
4040
4141 /**
4242 * @param string|array $key
43- * @param mixed $value
4443 *
4544 * @return $this
4645 */
@@ -57,7 +56,6 @@ public function with($key, $value = null): self
5756
5857 /**
5958 * @param string|array $key
60- * @param mixed $value
6159 *
6260 * @return $this
6361 */
@@ -111,19 +109,19 @@ public function resolveProperties(Request $request, array $props): array
111109 {
112110 $ isPartial = $ request ->header (Header::PARTIAL_COMPONENT ) === $ this ->component ;
113111
114- if (! $ isPartial ) {
112+ if (! $ isPartial ) {
115113 $ props = array_filter ($ this ->props , static function ($ prop ) {
116114 return ! ($ prop instanceof LazyProp);
117115 });
118116 }
119117
120118 $ props = $ this ->resolveArrayableProperties ($ props , $ request );
121119
122- if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_ONLY )) {
120+ if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_ONLY )) {
123121 $ props = $ this ->resolveOnly ($ request , $ props );
124122 }
125123
126- if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_EXCEPT )) {
124+ if ($ isPartial && $ request ->hasHeader (Header::PARTIAL_EXCEPT )) {
127125 $ props = $ this ->resolveExcept ($ request , $ props );
128126 }
129127
@@ -168,7 +166,7 @@ public function resolveOnly(Request $request, array $props): array
168166
169167 $ value = [];
170168
171- foreach ($ only as $ key ) {
169+ foreach ($ only as $ key ) {
172170 Arr::set ($ value , $ key , data_get ($ props , $ key ));
173171 }
174172
0 commit comments