Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit248840f

Browse files
committed
Test if PropertyAccess component is available
1 parent535c874 commit248840f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/Symfony/Component/Validator/Constraints/UniqueValidator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
useSymfony\Component\PropertyAccess\PropertyAccessorInterface;
1616
useSymfony\Component\Validator\Constraint;
1717
useSymfony\Component\Validator\ConstraintValidator;
18+
useSymfony\Component\Validator\Exception\LogicException;
1819
useSymfony\Component\Validator\Exception\UnexpectedTypeException;
1920
useSymfony\Component\Validator\Exception\UnexpectedValueException;
2021

@@ -103,6 +104,10 @@ private function reduceElementKeys(array $fields, array|object $element): array
103104
privatefunctiongetPropertyAccessor():PropertyAccessorInterface
104105
{
105106
if (null ===$this->propertyAccessor) {
107+
if (!class_exists(PropertyAccess::class)) {
108+
thrownewLogicException('Unable to use property path as the Symfony PropertyAccess component is not installed.');
109+
}
110+
106111
$this->propertyAccessor = PropertyAccess::createPropertyAccessor();
107112
}
108113

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp