|
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 |
|
16 /** |
|
17 * ParameterBagInterface. |
|
18 * |
|
19 * @author Fabien Potencier <fabien@symfony.com> |
|
20 * |
|
21 * @api |
|
22 */ |
|
23 interface ParameterBagInterface |
|
24 { |
|
25 /** |
|
26 * Clears all parameters. |
|
27 * |
|
28 * @api |
|
29 */ |
|
30 function clear(); |
|
31 |
|
32 /** |
|
33 * Adds parameters to the service container parameters. |
|
34 * |
|
35 * @param array $parameters An array of parameters |
|
36 * |
|
37 * @api |
|
38 */ |
|
39 function add(array $parameters); |
|
40 |
|
41 /** |
|
42 * Gets the service container parameters. |
|
43 * |
|
44 * @return array An array of parameters |
|
45 * |
|
46 * @api |
|
47 */ |
|
48 function all(); |
|
49 |
|
50 /** |
|
51 * Gets a service container parameter. |
|
52 * |
|
53 * @param string $name The parameter name |
|
54 * |
|
55 * @return mixed The parameter value |
|
56 * |
|
57 * @throws ParameterNotFoundException if the parameter is not defined |
|
58 * |
|
59 * @api |
|
60 */ |
|
61 function get($name); |
|
62 |
|
63 /** |
|
64 * Sets a service container parameter. |
|
65 * |
|
66 * @param string $name The parameter name |
|
67 * @param mixed $value The parameter value |
|
68 * |
|
69 * @api |
|
70 */ |
|
71 function set($name, $value); |
|
72 |
|
73 /** |
|
74 * Returns true if a parameter name is defined. |
|
75 * |
|
76 * @param string $name The parameter name |
|
77 * |
|
78 * @return Boolean true if the parameter name is defined, false otherwise |
|
79 * |
|
80 * @api |
|
81 */ |
|
82 function has($name); |
|
83 |
|
84 /** |
|
85 * Replaces parameter placeholders (%name%) by their values for all parameters. |
|
86 */ |
|
87 function resolve(); |
|
88 |
|
89 /** |
|
90 * Replaces parameter placeholders (%name%) by their values. |
|
91 * |
|
92 * @param mixed $value A value |
|
93 * |
|
94 * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist |
|
95 */ |
|
96 function resolveValue($value); |
|
97 } |