Skip to content

Commit 6e79036

Browse files
committed
Renamed ProvidesInertiaProps to ProvidesInertiaProperties
1 parent c8ea24b commit 6e79036

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/ProvidesInertiaProps.php renamed to src/ProvidesInertiaProperties.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Inertia;
44

5-
interface ProvidesInertiaProps
5+
interface ProvidesInertiaProperties
66
{
77
public function toInertiaProps(RenderContext $context): iterable;
88
}

src/Response.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public function __construct(string $component, array $props, string $rootView =
5050
}
5151

5252
/**
53-
* @param string|array|ProvidesInertiaProps $key
53+
* @param string|array|ProvidesInertiaProperties $key
5454
* @param mixed $value
5555
* @return $this
5656
*/
5757
public function with($key, $value = null): self
5858
{
59-
if ($key instanceof ProvidesInertiaProps) {
59+
if ($key instanceof ProvidesInertiaProperties) {
6060
$this->props[] = $key;
6161
} elseif (is_array($key)) {
6262
$this->props = array_merge($this->props, $key);
@@ -143,7 +143,7 @@ public function resolveProperties(Request $request, array $props): array
143143
}
144144

145145
/**
146-
* Resolve the ProvidesInertiaProps props.
146+
* Resolve the ProvidesInertiaProperties props.
147147
*/
148148
public function resolveInertiaPropsProviders(array $props, Request $request): array
149149
{
@@ -152,7 +152,7 @@ public function resolveInertiaPropsProviders(array $props, Request $request): ar
152152
$renderContext = new RenderContext($this->component, $request);
153153

154154
foreach ($props as $key => $value) {
155-
if (is_numeric($key) && $value instanceof ProvidesInertiaProps) {
155+
if (is_numeric($key) && $value instanceof ProvidesInertiaProperties) {
156156
// Pipe into a Collection to leverage Collection::getArrayableItems()
157157
$newProps = array_merge(
158158
$newProps,

src/ResponseFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ public function always($value): AlwaysProp
151151
}
152152

153153
/**
154-
* @param array|Arrayable|ProvidesInertiaProps $props
154+
* @param array|Arrayable|ProvidesInertiaProperties $props
155155
*/
156156
public function render(string $component, $props = []): Response
157157
{
158158
if ($props instanceof Arrayable) {
159159
$props = $props->toArray();
160-
} elseif ($props instanceof ProvidesInertiaProps) {
160+
} elseif ($props instanceof ProvidesInertiaProperties) {
161161
// Will be resolved in Response::resolveResponsableProperties()
162162
$props = [$props];
163163
}

tests/ResponseFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Inertia\LazyProp;
1818
use Inertia\MergeProp;
1919
use Inertia\OptionalProp;
20-
use Inertia\ProvidesInertiaProps;
20+
use Inertia\ProvidesInertiaProperties;
2121
use Inertia\RenderContext;
2222
use Inertia\ResponseFactory;
2323
use Inertia\Tests\Stubs\ExampleMiddleware;
@@ -358,7 +358,7 @@ public function toArray()
358358
public function test_will_accept_instances_of_provides_inertia_props()
359359
{
360360
Route::middleware([StartSession::class, ExampleMiddleware::class])->get('/', function () {
361-
return Inertia::render('User/Edit', new class implements ProvidesInertiaProps
361+
return Inertia::render('User/Edit', new class implements ProvidesInertiaProperties
362362
{
363363
public function toInertiaProps(RenderContext $context): iterable
364364
{

tests/ResponseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Inertia\Inertia;
1818
use Inertia\LazyProp;
1919
use Inertia\MergeProp;
20-
use Inertia\ProvidesInertiaProps;
20+
use Inertia\ProvidesInertiaProperties;
2121
use Inertia\RenderContext;
2222
use Inertia\Response;
2323
use Inertia\Tests\Stubs\FakeResource;
@@ -767,7 +767,7 @@ public function test_inertia_responsable_objects(): void
767767

768768
$response = new Response('User/Edit', [
769769
'foo' => 'bar',
770-
new class implements ProvidesInertiaProps
770+
new class implements ProvidesInertiaProperties
771771
{
772772
public function toInertiaProps(RenderContext $context): iterable
773773
{
@@ -872,7 +872,7 @@ public function test_props_can_be_added_using_the_with_method(): void
872872

873873
$response->with(['foo' => 'bar', 'baz' => 'qux'])
874874
->with(['quux' => 'corge'])
875-
->with(new class implements ProvidesInertiaProps
875+
->with(new class implements ProvidesInertiaProperties
876876
{
877877
public function toInertiaProps(RenderContext $context): iterable
878878
{

0 commit comments

Comments
 (0)