Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DependencyInjection] added a check for circular references in parame…
…ter definitions
- Loading branch information
Showing
3 changed files
with
85 additions
and
12 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\DependencyInjection\Exception; | ||
|
||
/** | ||
* This exception is thrown when a circular reference in a parameter is detected. | ||
* | ||
* @author Fabien Potencier <fabien@symfony.com> | ||
*/ | ||
class ParameterCircularReferenceException extends RuntimeException | ||
{ | ||
private $parameters; | ||
|
||
public function __construct($parameters) | ||
{ | ||
parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0])); | ||
|
||
$this->parameters = $parameters; | ||
} | ||
|
||
public function getParameters() | ||
{ | ||
return $this->parameters; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters