|
18 | 18 | */ |
19 | 19 | interface sfServiceContainerInterface |
20 | 20 | { |
| 21 | + /** |
| 22 | + * Sets the service container parameters. |
| 23 | + * All previously defined parameters would be removed. |
| 24 | + * |
| 25 | + * @see addParameters() |
| 26 | + * |
| 27 | + * @param array $parameters An array of parameters |
| 28 | + */ |
21 | 29 | public function setParameters(array $parameters); |
22 | | - |
| 30 | + |
| 31 | + /** |
| 32 | + * Adds parameters to the service container parameters. |
| 33 | + * |
| 34 | + * @param array $parameters An array of parameters |
| 35 | + */ |
23 | 36 | public function addParameters(array $parameters); |
24 | | - |
| 37 | + |
| 38 | + /** |
| 39 | + * Gets the service container parameters. |
| 40 | + * |
| 41 | + * @return array An array of parameters |
| 42 | + */ |
25 | 43 | public function getParameters(); |
26 | | - |
| 44 | + |
| 45 | + /** |
| 46 | + * Gets a service container parameter. |
| 47 | + * |
| 48 | + * @param string $name The parameter name |
| 49 | + * |
| 50 | + * @return mixed The parameter value |
| 51 | + * |
| 52 | + * @throw InvalidArgumentException if the parameter is not defined |
| 53 | + */ |
27 | 54 | public function getParameter($name); |
28 | | - |
| 55 | + |
| 56 | + /** |
| 57 | + * Sets a service container parameter. |
| 58 | + * |
| 59 | + * @param string $name The parameter name |
| 60 | + * @param mixed $value The parameter value |
| 61 | + */ |
29 | 62 | public function setParameter($name, $value); |
30 | | - |
| 63 | + |
| 64 | + /** |
| 65 | + * Returns true if a parameter name is defined. |
| 66 | + * |
| 67 | + * @param string $name The parameter name |
| 68 | + * |
| 69 | + * @return Boolean true if the parameter name is defined, false otherwise |
| 70 | + */ |
31 | 71 | public function hasParameter($name); |
32 | | - |
| 72 | + |
| 73 | + /** |
| 74 | + * Sets a service. |
| 75 | + * |
| 76 | + * @param string $id The service identifier |
| 77 | + * @param object $service The service instance |
| 78 | + */ |
33 | 79 | public function setService($id, $service); |
34 | | - |
| 80 | + |
| 81 | + /** |
| 82 | + * Gets a service. |
| 83 | + * |
| 84 | + * If a service is both defined through a setService() method and |
| 85 | + * with a set*Service() method, the former has always precedence. |
| 86 | + * |
| 87 | + * @param string $id The service identifier |
| 88 | + * |
| 89 | + * @return object The associated service |
| 90 | + * |
| 91 | + * @throw InvalidArgumentException if the service is not defined |
| 92 | + */ |
35 | 93 | public function getService($id); |
36 | | - |
37 | | - public function hasService($name); |
| 94 | + |
| 95 | + /** |
| 96 | + * Returns true if the given service is defined. |
| 97 | + * |
| 98 | + * @param string $id The service identifier |
| 99 | + * |
| 100 | + * @return Boolean true if the service is defined, false otherwise |
| 101 | + */ |
| 102 | + public function hasService($id); |
38 | 103 | } |
0 commit comments