mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Add BC layer for IRIConverter constructor change
This commit is contained in:
parent
3b9b02265d
commit
8a9700cbbf
2 changed files with 14 additions and 2 deletions
|
|
@ -31,6 +31,18 @@ SYLIUS_TELEMETRY_SALT=your-custom-salt
|
||||||
|
|
||||||
## Deprecations
|
## Deprecations
|
||||||
|
|
||||||
|
1. Not injecting a `Sylius\Bundle\ApiBundle\ApiPlatform\Routing\IriConverter` with `ApiPlatform\Metadata\ResourceClassResolverInterface` is deprecated since Sylius 2.2 and will be required in Sylius 3.0.
|
||||||
|
|
||||||
|
```php
|
||||||
|
public function __construct(
|
||||||
|
IriConverterInterface $decoratedIriConverter,
|
||||||
|
PathPrefixProviderInterface $pathPrefixProvider,
|
||||||
|
OperationResolverInterface $operationResolver,
|
||||||
|
RouterInterface $router,
|
||||||
|
+ ?ResourceClassResolverInterface $resourceClassResolver = null,
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
1. Not injecting a `tagged_iterator` with the tag `sylius_shop.modifier.address_form_values` into the constructor of `Sylius\Bundle\ShopBundle\Twig\Component\Checkout\Address\FormComponent` is deprecated since Sylius 2.2 and will be required in Sylius 3.0.
|
1. Not injecting a `tagged_iterator` with the tag `sylius_shop.modifier.address_form_values` into the constructor of `Sylius\Bundle\ShopBundle\Twig\Component\Checkout\Address\FormComponent` is deprecated since Sylius 2.2 and will be required in Sylius 3.0.
|
||||||
|
|
||||||
This change enables extending the checkout address form with custom fields or logic by registering services tagged with `sylius_shop.modifier.address_form_values`, which implement the `AddressFormValuesModifierInterface`.
|
This change enables extending the checkout address form with custom fields or logic by registering services tagged with `sylius_shop.modifier.address_form_values`, which implement the `AddressFormValuesModifierInterface`.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ final readonly class IriConverter implements IriConverterInterface
|
||||||
private PathPrefixProviderInterface $pathPrefixProvider,
|
private PathPrefixProviderInterface $pathPrefixProvider,
|
||||||
private OperationResolverInterface $operationResolver,
|
private OperationResolverInterface $operationResolver,
|
||||||
private RouterInterface $router,
|
private RouterInterface $router,
|
||||||
private ResourceClassResolverInterface $resourceClassResolver,
|
private ?ResourceClassResolverInterface $resourceClassResolver = null,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ final readonly class IriConverter implements IriConverterInterface
|
||||||
$resourceClass = $resource;
|
$resourceClass = $resource;
|
||||||
} else {
|
} else {
|
||||||
$objectClass = $this->getObjectClass($resource);
|
$objectClass = $this->getObjectClass($resource);
|
||||||
$resourceClass = $this->resourceClassResolver->isResourceClass($objectClass)
|
$resourceClass = $this->resourceClassResolver !== null && $this->resourceClassResolver->isResourceClass($objectClass)
|
||||||
? $this->resourceClassResolver->getResourceClass($resource)
|
? $this->resourceClassResolver->getResourceClass($resource)
|
||||||
: $objectClass;
|
: $objectClass;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue