public function __construct($serviceName, ContainerInterface $container) { if ($name = $container->name()) { $containerMessage = ' in the container "' . $name . '".'; } else { $containerMessage = '. Additionally the container it was requested in was not registered.'; } parent::__construct(sprintf('The service "%s" is not registered%s', $serviceName, $containerMessage)); }
public function init(Di\ContainerInterface $container) { $container->template('routerTemplate'); }
private function applyTypes(ContainerInterface $container, MethodReflector $method) { if ($method->getDocBlock()->hasTag(self::DOC_TAG_RETURN)) { $container->setTypes($method->getName(), $method->getDocBlock()->getTag(self::DOC_TAG_RETURN)->getTypes()); } }