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 * Removes a parameter.
61 * @param string $name The parameter name
63 public function remove($name);
66 * Sets a service container parameter.
68 * @param string $name The parameter name
69 * @param mixed $value The parameter value
71 * @throws LogicException if the parameter can not be set
73 public function set($name, $value);
76 * Returns true if a parameter name is defined.
78 * @param string $name The parameter name
80 * @return bool true if the parameter name is defined, false otherwise
82 public function has($name);
85 * Replaces parameter placeholders (%name%) by their values for all parameters.
87 public function resolve();
90 * Replaces parameter placeholders (%name%) by their values.
92 * @param mixed $value A value
94 * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
96 public function resolveValue($value);
99 * Escape parameter placeholders %.
101 * @param mixed $value
105 public function escapeValue($value);
108 * Unescape parameter placeholders %.
110 * @param mixed $value
114 public function unescapeValue($value);