docgen normalization for relation

This commit is contained in:
2021-12-09 12:44:41 +01:00
parent 5d24bd4d11
commit 24a404964b
11 changed files with 396 additions and 24 deletions

View File

@@ -98,8 +98,9 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
if ($reflection->hasProperty($attribute->getName())) {
if (!$reflection->getProperty($attribute->getName())->hasType()) {
throw new \LogicException(sprintf(
'Could not determine how the content is determined for the attribute %s. Add a type on this property',
$attribute->getName()
'Could not determine how the content is determined for the attribute %s on class %s. Add a type on this property',
$attribute->getName(),
$reflection->getName()
));
}
@@ -107,8 +108,9 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
} elseif ($reflection->hasMethod($method = 'get' . ucfirst($attribute->getName()))) {
if (!$reflection->getMethod($method)->hasReturnType()) {
throw new \LogicException(sprintf(
'Could not determine how the content is determined for the attribute %s. Add a return type on the method',
$attribute->getName()
'Could not determine how the content is determined for the attribute %s on class %s. Add a return type on the method',
$attribute->getName(),
$reflection->getName()
));
}
@@ -116,8 +118,9 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
} elseif ($reflection->hasMethod($method = 'is' . ucfirst($attribute->getName()))) {
if (!$reflection->getMethod($method)->hasReturnType()) {
throw new \LogicException(sprintf(
'Could not determine how the content is determined for the attribute %s. Add a return type on the method',
$attribute->getName()
'Could not determine how the content is determined for the attribute %s on class %s. Add a return type on the method',
$attribute->getName(),
$reflection->getName()
));
}
@@ -125,8 +128,9 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
} elseif ($reflection->hasMethod($attribute->getName())) {
if (!$reflection->getMethod($attribute->getName())->hasReturnType()) {
throw new \LogicException(sprintf(
'Could not determine how the content is determined for the attribute %s. Add a return type on the method',
$attribute->getName()
'Could not determine how the content is determined for the attribute %s on class %s. Add a return type on the method',
$attribute->getName(),
$reflection->getName()
));
}