mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-13 04:59:24 +03:00
Fix nullable array variables
This commit is contained in:
parent
f16ac2e785
commit
2a3b2df56a
@ -28,7 +28,7 @@ class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistr
|
|||||||
$this->propertyDescribers = $propertyDescribers;
|
$this->propertyDescribers = $propertyDescribers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$type = $type->getCollectionValueType();
|
$type = $type->getCollectionValueType();
|
||||||
if (null === $type) {
|
if (null === $type) {
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
class BooleanPropertyDescriber implements PropertyDescriberInterface
|
class BooleanPropertyDescriber implements PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$property->setType('boolean');
|
$property->setType('boolean');
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
class DateTimePropertyDescriber implements PropertyDescriberInterface
|
class DateTimePropertyDescriber implements PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$property->setType('string');
|
$property->setType('string');
|
||||||
$property->setFormat('date-time');
|
$property->setFormat('date-time');
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
class FloatPropertyDescriber implements PropertyDescriberInterface
|
class FloatPropertyDescriber implements PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$property->setType('number');
|
$property->setType('number');
|
||||||
$property->setFormat('float');
|
$property->setFormat('float');
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
class IntegerPropertyDescriber implements PropertyDescriberInterface
|
class IntegerPropertyDescriber implements PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$property->setType('integer');
|
$property->setType('integer');
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegist
|
|||||||
{
|
{
|
||||||
use ModelRegistryAwareTrait;
|
use ModelRegistryAwareTrait;
|
||||||
|
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$type = new Type($type->getBuiltinType(), false, $type->getClassName(), $type->isCollection(), $type->getCollectionKeyType(), $type->getCollectionValueType()); // ignore nullable field
|
$type = new Type($type->getBuiltinType(), false, $type->getClassName(), $type->isCollection(), $type->getCollectionKeyType(), $type->getCollectionValueType()); // ignore nullable field
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
interface PropertyDescriberInterface
|
interface PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups);
|
public function describe(Type $type, Schema $property, array $groups = null);
|
||||||
|
|
||||||
public function supports(Type $type): bool;
|
public function supports(Type $type): bool;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\PropertyInfo\Type;
|
|||||||
|
|
||||||
class StringPropertyDescriber implements PropertyDescriberInterface
|
class StringPropertyDescriber implements PropertyDescriberInterface
|
||||||
{
|
{
|
||||||
public function describe(Type $type, Schema $property, array $groups)
|
public function describe(Type $type, Schema $property, array $groups = null)
|
||||||
{
|
{
|
||||||
$property->setType('string');
|
$property->setType('string');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user