Skip to content

Commit a03a2f6

Browse files
committed
minor symfony#57790 [Validator] Use CPP in AbstractComparisonValidator, BicValidator, Ran… (andreybolonin)
This PR was merged into the 7.2 branch. Discussion ---------- [Validator] Use CPP in AbstractComparisonValidator, BicValidator, Ran… | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Following the multiple PRs converting constructors across the codebase Commits ------- d3f5a3f [Validator] Use CPP in AbstractComparisonValidator, BicValidator, RangeValidator
2 parents 7484a85 + d3f5a3f commit a03a2f6

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@
2727
*/
2828
abstract class AbstractComparisonValidator extends ConstraintValidator
2929
{
30-
private ?PropertyAccessorInterface $propertyAccessor;
31-
32-
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
30+
public function __construct(private ?PropertyAccessorInterface $propertyAccessor = null)
3331
{
34-
$this->propertyAccessor = $propertyAccessor;
3532
}
3633

3734
public function validate(mixed $value, Constraint $constraint): void

src/Symfony/Component/Validator/Constraints/BicValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ class BicValidator extends ConstraintValidator
5656
'EA' => 'ES', // Ceuta and Melilla
5757
];
5858

59-
private ?PropertyAccessor $propertyAccessor;
60-
61-
public function __construct(?PropertyAccessor $propertyAccessor = null)
59+
public function __construct(private ?PropertyAccessor $propertyAccessor = null)
6260
{
63-
$this->propertyAccessor = $propertyAccessor;
6461
}
6562

6663
public function validate(mixed $value, Constraint $constraint): void

src/Symfony/Component/Validator/Constraints/RangeValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424
*/
2525
class RangeValidator extends ConstraintValidator
2626
{
27-
private ?PropertyAccessorInterface $propertyAccessor;
28-
29-
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
27+
public function __construct(private ?PropertyAccessorInterface $propertyAccessor = null)
3028
{
31-
$this->propertyAccessor = $propertyAccessor;
3229
}
3330

3431
public function validate(mixed $value, Constraint $constraint): void

0 commit comments

Comments
 (0)