Fix a Deprecated Method Call on Symfony 5.3

This commit is contained in:
Christopher Davis 2021-11-06 07:28:13 -05:00
parent 7357de9c16
commit 76949ca537

View File

@ -28,6 +28,9 @@ class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegist
false, false,
$types[0]->getClassName(), $types[0]->getClassName(),
$types[0]->isCollection(), $types[0]->isCollection(),
// BC layer for symfony < 5.3
method_exists($types[0], 'getCollectionKeyTypes') ?
($types[0]->getCollectionKeyTypes()[0] ?? null) :
$types[0]->getCollectionKeyType(), $types[0]->getCollectionKeyType(),
// BC layer for symfony < 5.3 // BC layer for symfony < 5.3
method_exists($types[0], 'getCollectionValueTypes') ? method_exists($types[0], 'getCollectionValueTypes') ?