mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Fix property_exists for SymfonyConstraintAnnotationReader
This commit is contained in:
parent
4436c468f1
commit
3f6afe54cd
@ -49,7 +49,7 @@ class SymfonyConstraintAnnotationReader
|
|||||||
foreach ($annotations as $annotation) {
|
foreach ($annotations as $annotation) {
|
||||||
if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) {
|
if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) {
|
||||||
// To support symfony/validator < 4.3
|
// 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
|
// The field is optional
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase
|
|||||||
|
|
||||||
public function testOptionalProperty()
|
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.');
|
$this->markTestSkipped('NotBlank::allowNull was added in symfony/validator 4.3.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user