* @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:----dCO4V1Qhp93WQvsiv80Ufz2zLGpGx3NP7nXqaw24FrkwNcso+WYAM6/9NCQe+a8N0OTXdbfgeSFhF1vI0Yk+RRGQJ3hhjCkRPXHtAyL3ju721A4PtTc80spOYyR+2/HeXEIy10yqG9SLHtiHaz5ClQRgEUsmxOnJhAtfR4mX2iOmMa6nRRuuVTZIrpXEIwuVHw5mmaGGhOlR+pLrUPbMvdcoVH6Fcy244ukQyHMWmNutYKu2Hm6ZDt55u+ShS7FuBV59mrfOGTj2xqrwE02oLqC7IyNWwwn2OYy98XlnmnUr1JnBkDiqWi4EOjGm1eVuTKak7AM0p8QGcROLP3GF/iPgo4DPh0VEZEopcc68CnaCHGCLbXKeFN21f8l7vQo2jdQrsLBeW85XSy1JVfgPsxbqofUs1gibCCXnSLWrOoxYp4F0mv7iolnCSmF0RhSWp4bc4IkOygT1aXfaUWuCtMwCICfvuJscGNE7izLpGOdxSjpwt03ocYkqKUhs+ar+iB291PfccMrOcKzB+2CPQArjH/ZaXnamezHuq66f3ye8MzChImHVGVwSlhR8Q7IeUCm8aQBB3WpGFB+VQ3pHEVKJ87CFUSbN2f6L49ya18cCjxOPy1jgphMvQsrplxdNLK9U6r39n9kE+Gk8qZr3IE2B/xiGlCzb1K0MPsTF60w=----ATTACHMENT:----ODYwMjU2MDE0MzI3MjI4MyA4MTU5NTg2NjI4ODEzMzM4IDU2MDc4NjY0ODMyMjEyMA==