Skip to content

Commit

Permalink
Fix property_exists for SymfonyConstraintAnnotationReader
Browse files Browse the repository at this point in the history
  • Loading branch information
akalineskou authored and GuilhemN committed Sep 29, 2020
1 parent f6edaf8 commit 290df23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function updateProperty($reflection, Schema $property)
foreach ($annotations as $annotation) {
if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) {
// To support symfony/validator < 4.3
if ($annotation instanceof Assert\NotBlank && \method_exists($annotation, 'allowNull') && $annotation->allowNull) {
if ($annotation instanceof Assert\NotBlank && \property_exists($annotation, 'allowNull') && $annotation->allowNull) {
// The field is optional
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testUpdatePropertyFix1283()

public function testOptionalProperty()
{
if (!\method_exists(Assert\NotBlank::class, 'allowNull')) {
if (!\property_exists(Assert\NotBlank::class, 'allowNull')) {
$this->markTestSkipped('NotBlank::allowNull was added in symfony/validator 4.3.');
}

Expand Down

0 comments on commit 290df23

Please sign in to comment.