Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DependencyInjection] Added missing support for setting previous exce…

…ption
  • Loading branch information...
commit e125ed8783c65d06b5f41a2ebbbb797fd304859a 1 parent 33cc43f
@hason hason authored
View
4 Exception/InactiveScopeException.php
@@ -21,9 +21,9 @@ class InactiveScopeException extends RuntimeException
private $serviceId;
private $scope;
- public function __construct($serviceId, $scope)
+ public function __construct($serviceId, $scope, \Exception $previous = null)
{
- parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope));
+ parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope), 0, $previous);
$this->serviceId = $serviceId;
$this->scope = $scope;
View
4 Exception/ParameterCircularReferenceException.php
@@ -20,9 +20,9 @@ class ParameterCircularReferenceException extends RuntimeException
{
private $parameters;
- public function __construct($parameters)
+ public function __construct($parameters, \Exception $previous = null)
{
- parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]));
+ parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0, $previous);
$this->parameters = $parameters;
}
View
4 Exception/ParameterNotFoundException.php
@@ -29,12 +29,14 @@ class ParameterNotFoundException extends InvalidArgumentException
* @param string $sourceId The service id that references the non-existent parameter
* @param string $sourceKey The parameter key that references the non-existent parameter
*/
- public function __construct($key, $sourceId = null, $sourceKey = null)
+ public function __construct($key, $sourceId = null, $sourceKey = null, \Exception $previous = null)
{
$this->key = $key;
$this->sourceId = $sourceId;
$this->sourceKey = $sourceKey;
+ parent::__construct('', 0, $previous);
+
$this->updateRepr();
}
View
4 Exception/ScopeCrossingInjectionException.php
@@ -23,7 +23,7 @@ class ScopeCrossingInjectionException extends RuntimeException
private $destServiceId;
private $destScope;
- public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope)
+ public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null)
{
parent::__construct(sprintf(
'Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. '
@@ -35,7 +35,7 @@ public function __construct($sourceServiceId, $sourceScope, $destServiceId, $des
$destScope,
$sourceScope,
$destScope
- ));
+ ), 0, $previous);
$this->sourceServiceId = $sourceServiceId;
$this->sourceScope = $sourceScope;
View
4 Exception/ScopeWideningInjectionException.php
@@ -23,7 +23,7 @@ class ScopeWideningInjectionException extends RuntimeException
private $destServiceId;
private $destScope;
- public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope)
+ public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null)
{
parent::__construct(sprintf(
'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. '
@@ -34,7 +34,7 @@ public function __construct($sourceServiceId, $sourceScope, $destServiceId, $des
$sourceServiceId,
$destScope,
$destServiceId
- ));
+ ), 0, $previous);
$this->sourceServiceId = $sourceServiceId;
$this->sourceScope = $sourceScope;
View
4 Exception/ServiceCircularReferenceException.php
@@ -21,9 +21,9 @@ class ServiceCircularReferenceException extends RuntimeException
private $serviceId;
private $path;
- public function __construct($serviceId, array $path)
+ public function __construct($serviceId, array $path, \Exception $previous = null)
{
- parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)));
+ parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous);
$this->serviceId = $serviceId;
$this->path = $path;
View
4 Exception/ServiceNotFoundException.php
@@ -21,7 +21,7 @@ class ServiceNotFoundException extends InvalidArgumentException
private $id;
private $sourceId;
- public function __construct($id, $sourceId = null)
+ public function __construct($id, $sourceId = null, \Exception $previous = null)
{
if (null === $sourceId) {
$msg = sprintf('You have requested a non-existent service "%s".', $id);
@@ -29,7 +29,7 @@ public function __construct($id, $sourceId = null)
$msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id);
}
- parent::__construct($msg);
+ parent::__construct($msg, 0, $previous);
$this->id = $id;
$this->sourceId = $sourceId;
Please sign in to comment.
Something went wrong with that request. Please try again.