From e8ce0960a2e0b14181a202629060bf1d266a7fd4 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Mon, 28 Sep 2020 10:36:17 -0300 Subject: [PATCH 1/2] Exclude development files from dist package --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8e1a1e6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +.* export-ignore +*.md export-ignore +Tests export-ignore +Resources/doc export-ignore +phpunit export-ignore +phpunit.xml.dist export-ignore From 290df23dc0060c4daaed95a7f37845f16a287ebd Mon Sep 17 00:00:00 2001 From: Alex Kalineskou Date: Mon, 28 Sep 2020 22:45:24 +0300 Subject: [PATCH 2/2] Fix property_exists for SymfonyConstraintAnnotationReader --- .../Annotations/SymfonyConstraintAnnotationReader.php | 2 +- .../Annotations/SymfonyConstraintAnnotationReaderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php b/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php index a6d3daa..8b4e989 100644 --- a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php +++ b/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php @@ -49,7 +49,7 @@ class SymfonyConstraintAnnotationReader 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; } diff --git a/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php b/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php index 36c5b78..100173f 100644 --- a/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php +++ b/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php @@ -49,7 +49,7 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase 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.'); }