class ResolveFactoryClassPass
@author Maxime Steinhausser <maxime.steinhausser@gmail.com>
Hierarchy
- class \Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
- class \Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass extends \Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass
Expanded class hierarchy of ResolveFactoryClassPass
File
-
vendor/
symfony/ dependency-injection/ Compiler/ ResolveFactoryClassPass.php, line 20
Namespace
Symfony\Component\DependencyInjection\CompilerView source
class ResolveFactoryClassPass extends AbstractRecursivePass {
protected bool $skipScalars = true;
protected function processValue(mixed $value, bool $isRoot = false) : mixed {
if ($value instanceof Definition && \is_array($factory = $value->getFactory()) && null === $factory[0]) {
if (null === ($class = $value->getClass())) {
throw new RuntimeException(\sprintf('The "%s" service is defined to be created by a factory, but is missing the factory class. Did you forget to define the factory or service class?', $this->currentId));
}
$factory[0] = $class;
$value->setFactory($factory);
}
return parent::processValue($value, $isRoot);
}
}