use Symfony\Contracts\Service\Attribute\Required;
/**
* Looks for definitions with autowiring enabled and registers their corresponding "#[Required]" methods as setters.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class AutowireRequiredMethodsPass extends AbstractRecursivePass
{ protected function processValue(mixed
$value, bool
$isRoot = false
): mixed
{ $value = parent::
processValue($value,
$isRoot);
if (!
$value instanceof Definition || !
$value->
isAutowired() ||
$value->
isAbstract() || !
$value->
getClass()) { return $value;
} if (!
$reflectionClass =
$this->container->
getReflectionClass($value->
getClass(), false
)) { return $value;
} $alreadyCalledMethods =
[];
$withers =
[];