Symfony\Component\DependencyInjection\Container::set
Sets a service.
Signature
public function set(string
$id,
[
$service = self::SCOPE_CONTAINER,
[string
$scope = self::SCOPE_CONTAINER]] )
Parameters
$id
— string- The service identifier
$service
— object- The service instance
$scope
— string- The scope of the service
Errors/Exceptions
-
RuntimeException
- When trying to set a service in an inactive scope
-
InvalidArgumentException
- When trying to set a service in the prototype scope