$violations[$translationDefinition->
getClass()][] =
sprintf('No return type is declared in `%s` for method `%s`',
$translationDefinition->
getClass(),
$method->
getName());
continue;
} $returnType =
$method->
getReturnType();
if (!
$returnType instanceof \ReflectionNamedType ||
$returnType->
getName() ===
$translationDefinition->
getParentDefinition()->
getEntityClass()) { continue;
} if (!
$returnType->
allowsNull() && !\
in_array($method->
getName(),
['getCustomFieldsValue', 'getCustomFieldsValues'
], true
)) { $violations[$translationDefinition->
getClass()][] =
sprintf('The return type of `%s` is not nullable. All getter functions of EntityTranslationDefinitions need to be nullable!',
$method->
getName());
} } return $violations;
} /**
* @return array<string, mixed>
*/
private function validateEntityTranslationDefinitions(EntityTranslationDefinition
$translationDefinition): array
{