From f03e33f551eb5d23e477753dc9dc82cd84b9730c Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Mon, 18 Dec 2017 21:07:44 +0100 Subject: [PATCH] Fix CS --- ModelDescriber/SwaggerPropertyAnnotationReader.php | 14 +++++++------- Tests/Functional/Entity/User.php | 2 +- Tests/Functional/FunctionalTest.php | 4 ++-- Tests/Functional/JMSFunctionalTest.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ModelDescriber/SwaggerPropertyAnnotationReader.php b/ModelDescriber/SwaggerPropertyAnnotationReader.php index 6d19853..f2c05bc 100644 --- a/ModelDescriber/SwaggerPropertyAnnotationReader.php +++ b/ModelDescriber/SwaggerPropertyAnnotationReader.php @@ -37,26 +37,26 @@ class SwaggerPropertyAnnotationReader { $swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class); if ($swgProperty instanceof SwgProperty) { - if ($swgProperty->type !== null) { + if (null !== $swgProperty->type) { $property->setType($swgProperty->type); } - if ($swgProperty->default !== UNDEFINED) { + if (UNDEFINED !== $swgProperty->default) { $property->setDefault($swgProperty->default); } - if ($swgProperty->enum !== null) { + if (null !== $swgProperty->enum) { $property->setEnum($swgProperty->enum); } if ($property instanceof Schema) { - if ($swgProperty->description !== null) { + if (null !== $swgProperty->description) { $property->setDescription($swgProperty->description); } - if ($swgProperty->title !== null) { + if (null !== $swgProperty->title) { $property->setTitle($swgProperty->title); } - if ($swgProperty->example !== null) { + if (null !== $swgProperty->example) { $property->setExample($swgProperty->example); } - if ($swgProperty->readOnly !== null) { + if (null !== $swgProperty->readOnly) { $property->setReadOnly($swgProperty->readOnly); } } diff --git a/Tests/Functional/Entity/User.php b/Tests/Functional/Entity/User.php index 750b770..68cc737 100644 --- a/Tests/Functional/Entity/User.php +++ b/Tests/Functional/Entity/User.php @@ -54,7 +54,7 @@ class User /** * @var float - * @SWG\Property(default = 0.0) + * @SWG\Property(default = 0.0) */ private $money; diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index 3a8d735..39227ae 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -156,7 +156,7 @@ class FunctionalTest extends WebTestCase 'money' => [ 'type' => 'number', 'format' => 'float', - 'default' => 0.0 + 'default' => 0.0, ], 'id' => [ 'type' => 'integer', @@ -195,7 +195,7 @@ class FunctionalTest extends WebTestCase ], 'status' => [ 'type' => 'string', - 'enum' => ["disabled", "enabled"], + 'enum' => ['disabled', 'enabled'], ], ], ], diff --git a/Tests/Functional/JMSFunctionalTest.php b/Tests/Functional/JMSFunctionalTest.php index 4fec31b..01d28a1 100644 --- a/Tests/Functional/JMSFunctionalTest.php +++ b/Tests/Functional/JMSFunctionalTest.php @@ -55,7 +55,7 @@ class JMSFunctionalTest extends WebTestCase ], 'status' => [ 'type' => 'string', - 'enum' => ["disabled", "enabled"], + 'enum' => ['disabled', 'enabled'], ], ], ], $this->getModel('JMSUser')->toArray());