Skip to content

Commit bfbaa75

Browse files
Refactor property resolution to filter initial properties and rename method for clarity
1 parent bfae861 commit bfbaa75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ public function toResponse($request)
142142
public function resolveProperties(Request $request, array $props): array
143143
{
144144
$props = $this->resolvePartialProperties($props, $request);
145+
$props = $this->filterInitialProps($props);
145146
$props = $this->resolveArrayableProperties($props, $request);
146147
$props = $this->resolveAlways($props);
147148
$props = $this->resolvePropertyInstances($props, $request);
148-
$props = $this->removeInitialProperties($props);
149149

150150
return $props;
151151
}
@@ -299,9 +299,9 @@ public function resolvePropertyInstances(array $props, Request $request): array
299299
}
300300

301301
/**
302-
* Remove initial properties from the response.
302+
* Filter initial properties from the props.
303303
*/
304-
public function removeInitialProperties(array $props): array
304+
public function filterInitialProps(array $props): array
305305
{
306306
return array_filter($props, static fn ($prop) => ! $prop instanceof InitialProp);
307307
}

0 commit comments

Comments
 (0)