Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\DependencyInjection\ParameterBag;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\DependencyInjection\Exception\LogicException;
|
Chris@0
|
15 use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
|
Chris@0
|
16
|
Chris@0
|
17 /**
|
Chris@0
|
18 * ParameterBagInterface.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @author Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
21 */
|
Chris@0
|
22 interface ParameterBagInterface
|
Chris@0
|
23 {
|
Chris@0
|
24 /**
|
Chris@0
|
25 * Clears all parameters.
|
Chris@0
|
26 *
|
Chris@0
|
27 * @throws LogicException if the ParameterBagInterface can not be cleared
|
Chris@0
|
28 */
|
Chris@0
|
29 public function clear();
|
Chris@0
|
30
|
Chris@0
|
31 /**
|
Chris@0
|
32 * Adds parameters to the service container parameters.
|
Chris@0
|
33 *
|
Chris@0
|
34 * @param array $parameters An array of parameters
|
Chris@0
|
35 *
|
Chris@0
|
36 * @throws LogicException if the parameter can not be added
|
Chris@0
|
37 */
|
Chris@0
|
38 public function add(array $parameters);
|
Chris@0
|
39
|
Chris@0
|
40 /**
|
Chris@0
|
41 * Gets the service container parameters.
|
Chris@0
|
42 *
|
Chris@0
|
43 * @return array An array of parameters
|
Chris@0
|
44 */
|
Chris@0
|
45 public function all();
|
Chris@0
|
46
|
Chris@0
|
47 /**
|
Chris@0
|
48 * Gets a service container parameter.
|
Chris@0
|
49 *
|
Chris@0
|
50 * @param string $name The parameter name
|
Chris@0
|
51 *
|
Chris@0
|
52 * @return mixed The parameter value
|
Chris@0
|
53 *
|
Chris@0
|
54 * @throws ParameterNotFoundException if the parameter is not defined
|
Chris@0
|
55 */
|
Chris@0
|
56 public function get($name);
|
Chris@0
|
57
|
Chris@0
|
58 /**
|
Chris@0
|
59 * Removes a parameter.
|
Chris@0
|
60 *
|
Chris@0
|
61 * @param string $name The parameter name
|
Chris@0
|
62 */
|
Chris@0
|
63 public function remove($name);
|
Chris@0
|
64
|
Chris@0
|
65 /**
|
Chris@0
|
66 * Sets a service container parameter.
|
Chris@0
|
67 *
|
Chris@0
|
68 * @param string $name The parameter name
|
Chris@0
|
69 * @param mixed $value The parameter value
|
Chris@0
|
70 *
|
Chris@0
|
71 * @throws LogicException if the parameter can not be set
|
Chris@0
|
72 */
|
Chris@0
|
73 public function set($name, $value);
|
Chris@0
|
74
|
Chris@0
|
75 /**
|
Chris@0
|
76 * Returns true if a parameter name is defined.
|
Chris@0
|
77 *
|
Chris@0
|
78 * @param string $name The parameter name
|
Chris@0
|
79 *
|
Chris@0
|
80 * @return bool true if the parameter name is defined, false otherwise
|
Chris@0
|
81 */
|
Chris@0
|
82 public function has($name);
|
Chris@0
|
83
|
Chris@0
|
84 /**
|
Chris@0
|
85 * Replaces parameter placeholders (%name%) by their values for all parameters.
|
Chris@0
|
86 */
|
Chris@0
|
87 public function resolve();
|
Chris@0
|
88
|
Chris@0
|
89 /**
|
Chris@0
|
90 * Replaces parameter placeholders (%name%) by their values.
|
Chris@0
|
91 *
|
Chris@0
|
92 * @param mixed $value A value
|
Chris@0
|
93 *
|
Chris@0
|
94 * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
|
Chris@0
|
95 */
|
Chris@0
|
96 public function resolveValue($value);
|
Chris@0
|
97
|
Chris@0
|
98 /**
|
Chris@0
|
99 * Escape parameter placeholders %.
|
Chris@0
|
100 *
|
Chris@0
|
101 * @param mixed $value
|
Chris@0
|
102 *
|
Chris@0
|
103 * @return mixed
|
Chris@0
|
104 */
|
Chris@0
|
105 public function escapeValue($value);
|
Chris@0
|
106
|
Chris@0
|
107 /**
|
Chris@0
|
108 * Unescape parameter placeholders %.
|
Chris@0
|
109 *
|
Chris@0
|
110 * @param mixed $value
|
Chris@0
|
111 *
|
Chris@0
|
112 * @return mixed
|
Chris@0
|
113 */
|
Chris@0
|
114 public function unescapeValue($value);
|
Chris@0
|
115 }
|