protected function guess(string
$class, string
$property, \Closure
$closure, mixed
$defaultValue = null
): ?Guess
{ $guesses =
[];
$classMetadata =
$this->metadataFactory->
getMetadataFor($class);
if ($classMetadata instanceof ClassMetadataInterface &&
$classMetadata->
hasPropertyMetadata($property)) { foreach ($classMetadata->
getPropertyMetadata($property) as $memberMetadata) { foreach ($memberMetadata->
getConstraints() as $constraint) { if ($guess =
$closure($constraint)) { $guesses[] =
$guess;
} } } } if (null !==
$defaultValue) { $guesses[] =
new ValueGuess($defaultValue, Guess::LOW_CONFIDENCE
);
}