public function __construct($parameters, Exception $previous = null) { if (version_compare(PHP_VERSION, '5.3') < 0) { parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0); } else { parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0, $previous); } $this->parameters = $parameters; }
public function __construct($serviceId, $scope, Exception $previous = null) { if (version_compare(PHP_VERSION, '5.3') < 0) { parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope), 0); } else { parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope), 0, $previous); } $this->serviceId = $serviceId; $this->scope = $scope; }
public function __construct($serviceId, array $path, Exception $previous = null) { if (version_compare(PHP_VERSION, '5.3') < 0) { parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0); } else { parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous); } $this->serviceId = $serviceId; $this->path = $path; }
public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, Exception $previous = null) { if (version_compare(PHP_VERSION, '5.3') < 0) { parent::__construct(sprintf('Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' . 'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' . 'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', $sourceServiceId, $destServiceId, $sourceServiceId, $destScope, $destServiceId), 0); } else { parent::__construct(sprintf('Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' . 'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' . 'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', $sourceServiceId, $destServiceId, $sourceServiceId, $destScope, $destServiceId), 0, $previous); } $this->sourceServiceId = $sourceServiceId; $this->sourceScope = $sourceScope; $this->destServiceId = $destServiceId; $this->destScope = $destScope; }
public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, Exception $previous = null) { if (version_compare(PHP_VERSION, '5.3') < 0) { parent::__construct(sprintf('Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. ' . 'This service might not be available consistently. Generally, it is safer to either move the definition "%s" to scope "%s", or ' . 'declare "%s" as a child scope of "%s". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.', $sourceServiceId, $destServiceId, $sourceServiceId, $destScope, $sourceScope, $destScope), 0); } else { parent::__construct(sprintf('Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. ' . 'This service might not be available consistently. Generally, it is safer to either move the definition "%s" to scope "%s", or ' . 'declare "%s" as a child scope of "%s". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.', $sourceServiceId, $destServiceId, $sourceServiceId, $destScope, $sourceScope, $destScope), 0, $previous); } $this->sourceServiceId = $sourceServiceId; $this->sourceScope = $sourceScope; $this->destServiceId = $destServiceId; $this->destScope = $destScope; }