Skip to content

Commit 9b8d2e5

Browse files
Brajk19HypeMC
authored andcommitted
rename DynamicValues::arg to propertyPath
1 parent 7c014a6 commit 9b8d2e5

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Attribute/RouteParamValue/DynamicValues.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class DynamicValues extends AbstractValues
1111
*/
1212
public function __construct(
1313
public readonly string $alias,
14-
public readonly ?string $arg = null,
14+
public readonly ?string $propertyPath = null,
1515
) {
1616
}
1717

@@ -20,7 +20,7 @@ public function __construct(
2020
*/
2121
protected function getValues(): array
2222
{
23-
return [$this->alias, $this->arg];
23+
return [$this->alias, $this->propertyPath];
2424
}
2525

2626
public static function type(): string

src/Cache/PropertyResolver/InverseValuesBuilder/DynamicInverseValuesBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function build(ValuesInterface $values, string $associationClass, string
2121
{
2222
return new DynamicValues(
2323
alias: $values->alias,
24-
arg: null !== $values->arg ? \sprintf('%s?.%s', $associationTarget, $values->arg) : $associationTarget,
24+
propertyPath: null !== $values->propertyPath ? \sprintf('%s?.%s', $associationTarget, $values->propertyPath) : $associationTarget,
2525
);
2626
}
2727
}

tests/Cache/PropertyResolver/InverseValuesBuildersTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testBuild(): void
5252

5353
$compoundValues = new CompoundValues(
5454
new DynamicValues('alias'),
55-
new DynamicValues('alias', arg: 'obj'),
55+
new DynamicValues('alias', propertyPath: 'obj'),
5656
new EnumValues(DummyIntEnum::class),
5757
new PropertyValues('obj'),
5858
new RawValues(1, null, 'str'),
@@ -61,10 +61,10 @@ public function testBuild(): void
6161

6262
self::assertEquals(
6363
expected: new CompoundValues(
64-
new DynamicValues('alias', arg: 'association'),
64+
new DynamicValues('alias', propertyPath: 'association'),
6565
new DynamicValues(
6666
alias: 'alias',
67-
arg: 'association?.obj',
67+
propertyPath: 'association?.obj',
6868
),
6969
new EnumValues(DummyIntEnum::class),
7070
new PropertyValues('association?.obj'),

tests/Functional/TestApplication/Controller/AnimalController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function tagAction(string $tag)
115115
'rating' => new CompoundValues(
116116
new DynamicValues(alias: 'purgatory.animal_rating2'),
117117
new DynamicValues(alias: 'purgatory.animal_rating1'),
118-
new DynamicValues(alias: 'purgatory.animal_rating3', arg: 'owner'),
118+
new DynamicValues(alias: 'purgatory.animal_rating3', propertyPath: 'owner'),
119119
),
120120
],
121121
)]

0 commit comments

Comments
 (0)