4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection\ParameterBag;
14 use Symfony\Component\DependencyInjection\Exception\LogicException;
15 use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
18 * ParameterBagInterface.
20 * @author Fabien Potencier <fabien@symfony.com>
22 interface ParameterBagInterface
25 * Clears all parameters.
27 * @throws LogicException if the ParameterBagInterface can not be cleared
29 public function clear();
32 * Adds parameters to the service container parameters.
34 * @param array $parameters An array of parameters
36 * @throws LogicException if the parameter can not be added
38 public function add(array $parameters);
41 * Gets the service container parameters.
43 * @return array An array of parameters
45 public function all();
48 * Gets a service container parameter.
50 * @param string $name The parameter name
52 * @return mixed The parameter value
54 * @throws ParameterNotFoundException if the parameter is not defined
56 public function get($name);
59 * Sets a service container parameter.
61 * @param string $name The parameter name
62 * @param mixed $value The parameter value
64 * @throws LogicException if the parameter can not be set
66 public function set($name, $value);
69 * Returns true if a parameter name is defined.
71 * @param string $name The parameter name
73 * @return bool true if the parameter name is defined, false otherwise
75 public function has($name);
78 * Replaces parameter placeholders (%name%) by their values for all parameters.
80 public function resolve();
83 * Replaces parameter placeholders (%name%) by their values.
85 * @param mixed $value A value
87 * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
89 public function resolveValue($value);
92 * Escape parameter placeholders %.
98 public function escapeValue($value);
101 * Unescape parameter placeholders %.
103 * @param mixed $value
107 public function unescapeValue($value);