|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\DependencyInjection\ParameterBag; |
| 13 | + |
| 14 | +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; |
| 15 | +use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; |
| 16 | +use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
| 17 | + |
| 18 | +/** |
| 19 | + * Replaces parameter placeholders (%name%) by their values. |
| 20 | + * |
| 21 | + * @author Ener-Getick <egetick@gmail.com> |
| 22 | + */ |
| 23 | +interface ParameterResolverInterface |
| 24 | +{ |
| 25 | + /** |
| 26 | + * Replaces parameter placeholders (%name%) by their values. |
| 27 | + * |
| 28 | + * @param mixed $value A value |
| 29 | + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) |
| 30 | + * |
| 31 | + * @return mixed The resolved value |
| 32 | + * |
| 33 | + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist |
| 34 | + * @throws ParameterCircularReferenceException if a circular reference is detected |
| 35 | + * @throws RuntimeException when a given parameter has a type problem. |
| 36 | + */ |
| 37 | + public function resolveValue($value, array $resolving = array()); |
| 38 | + |
| 39 | + /** |
| 40 | + * Resolves parameters inside a string. |
| 41 | + * |
| 42 | + * @param string $value The string to resolve |
| 43 | + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) |
| 44 | + * |
| 45 | + * @return string The resolved string |
| 46 | + * |
| 47 | + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist |
| 48 | + * @throws ParameterCircularReferenceException if a circular reference is detected |
| 49 | + * @throws RuntimeException when a given parameter has a type problem. |
| 50 | + */ |
| 51 | + public function resolveString($value, array $resolving = array()); |
| 52 | +} |
0 commit comments