mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[CoreBundle] Remove deprecated code in the AddressType class
This commit is contained in:
parent
54240b2ebb
commit
db4e53dd55
3 changed files with 13 additions and 16 deletions
|
|
@ -61,6 +61,16 @@
|
|||
* `Sylius\Bundle\ApiBundle\CommandHandler\Account\VerifyCustomerAccountHandler`
|
||||
* `Sylius\Component\Taxation\Checker\TaxRateDateEligibilityChecker`
|
||||
|
||||
* The parameter order of `Sylius\Bundle\CoreBundle\Form\Type\Checkout\AddressType::__construct` has been changed:
|
||||
```php
|
||||
public function __construct(
|
||||
+ private readonly AddressComparatorInterface $addressComparator,
|
||||
string $dataClass,
|
||||
array $validationGroups = []
|
||||
- private readonly AddressComparatorInterface $addressComparator = null,
|
||||
)
|
||||
```
|
||||
|
||||
## Frontend
|
||||
|
||||
* `use_webpack` option was removed from the `sylius_ui` configuration, and the Webpack has become the only module bundler provided by Sylius.
|
||||
|
|
|
|||
|
|
@ -33,22 +33,9 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class AddressType extends AbstractResourceType
|
||||
{
|
||||
private ?AddressComparatorInterface $addressComparator;
|
||||
|
||||
public function __construct(string $dataClass, array $validationGroups = [], ?AddressComparatorInterface $addressComparator = null)
|
||||
public function __construct(private readonly AddressComparatorInterface $addressComparator, string $dataClass, array $validationGroups = [])
|
||||
{
|
||||
parent::__construct($dataClass, $validationGroups);
|
||||
|
||||
if (null === $addressComparator) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'1.8',
|
||||
'Not passing an $addressComparator to "%s" constructor is deprecated and will be prohibited in Sylius 2.0.',
|
||||
self::class,
|
||||
);
|
||||
}
|
||||
|
||||
$this->addressComparator = $addressComparator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -164,7 +151,7 @@ final class AddressType extends AbstractResourceType
|
|||
|
||||
private function areAddressesDifferent(?AddressInterface $firstAddress, ?AddressInterface $secondAddress): bool
|
||||
{
|
||||
if (null === $this->addressComparator || null === $firstAddress || null === $secondAddress) {
|
||||
if (null === $firstAddress || null === $secondAddress) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@
|
|||
<defaults public="true" />
|
||||
|
||||
<service id="sylius.form.type.checkout_address" class="Sylius\Bundle\CoreBundle\Form\Type\Checkout\AddressType">
|
||||
<argument type="service" id="sylius.address_comparator" />
|
||||
<argument>%sylius.model.order.class%</argument>
|
||||
<argument>%sylius.form.type.checkout_address.validation_groups%</argument>
|
||||
<argument type="service" id="sylius.address_comparator" />
|
||||
<tag name="form.type" />
|
||||
</service>
|
||||
<service id="sylius.form.type.checkout_select_shipping" class="Sylius\Bundle\CoreBundle\Form\Type\Checkout\SelectShippingType">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue