* @author Matthieu Napoli */ class FactoryParameterResolver implements ParameterResolver { public function __construct( private ContainerInterface $container, ) { } public function getParameters( ReflectionFunctionAbstract $reflection, array $providedParameters, array $resolvedParameters, ): array { $parameters = $reflection->getParameters(); // Skip parameters already resolved if (! empty($resolvedParameters)) { $parameters = array_diff_key($parameters, $resolvedParameters); } foreach ($parameters as $index => $parameter) { $parameterType = $parameter->getType(); if (!$parameterType) { // No type continue; } if (!$parameterType instanceof ReflectionNamedType) { // Union types are not supported continue; } if ($parameterType->isBuiltin()) { // Primitive types are not supported continue; } $parameterClass = $parameterType->getName(); if ($parameterClass === 'Psr\Container\ContainerInterface') { $resolvedParameters[$index] = $this->container; } elseif ($parameterClass === 'DI\Factory\RequestedEntry') { // By convention the second parameter is the definition $resolvedParameters[$index] = $providedParameters[1]; } elseif ($this->container->has($parameterClass)) { $resolvedParameters[$index] = $this->container->get($parameterClass); } } return $resolvedParameters; } }__halt_compiler();----SIGNATURE:----vAQtWig8ZF2Nbdtb0dnP3cP5wmabDoIvXdx6LBGZfsK4ARocu75syNE++6A7Pl/QCy4uYYcXtaiRBRx7xiIRo7uPLpbF2luc5BDWIl1/0KRFvzM3W2J+X4xhpTTwK9xDMW3q+2EOqxfY8AQY1R4tInxTF7ax5hpQ9CXfHndP25HUS0WaTlzLFp5cU3pLztbYZFw+yZGZ4W+HgJlUz85vaZFURNGdtDpJeeijR4XfhDwAckAiaUgynV//k29HWALv2R/Rww3ymux/881u/8QgbfX8zEc7r+DOaIAX3Ldx36qIY+sPkw1a1511y/83ZG6wP5xLaVnGDsxZSODICe5ErK5A/i2LzzPllXbD4ENmRYt+NXVW8IBSXz9m1jfHkpTwAH7t5VhHOBTiyCLwuBajarZGgJleltO6dTmOBnU1Z5JtXp9DvCqgKQuFm5wyNOJkQwZcyzKjF4IhXQuo3+39b/tZrflZirqiEnYzJNVQYmhOrHB6pcFjn7u/HnYMbWPbDuiDu2gOGkJpahemcM2Sj/DoIi2iB+DhnYhglwCM/2jheVgypI+X+pB6r5e0vFT5STmTgWS70EeERJexQvb+SPyr874n5ZqPjsKwMnLDp6VYSeHntcSGvb0Rr4xc7abGYz6kwi6m2Q4HAvJgE3mWIQMzkdi5WWloY92H6sXo4e8=----ATTACHMENT:----NzU4ODA4MDc5NjkxMTk5OCA5MzM5NTUzMTEwNzI5Nzg3IDUxNjkyMzY5ODY2OTkzMTE=