Shares a given service in the container
Definition $definition:
mixed $service:
string $id:
private function shareService(Definition $definition, $service, $id) {
if (self::SCOPE_PROTOTYPE !== ($scope = $definition
->getScope())) {
if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) {
throw new InactiveScopeException($id, $scope);
}
$this->services[$lowerId = strtolower($id)] = $service;
if (self::SCOPE_CONTAINER !== $scope) {
$this->scopedServices[$scope][$lowerId] = $service;
}
}
}