Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/dependency-injection/ContainerInterface.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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; | |
13 | |
14 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; | |
15 use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; | |
16 use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | |
17 | |
18 /** | |
19 * ContainerInterface is the interface implemented by service container classes. | |
20 * | |
21 * @author Fabien Potencier <fabien@symfony.com> | |
22 * @author Johannes M. Schmitt <schmittjoh@gmail.com> | |
23 */ | |
24 interface ContainerInterface | |
25 { | |
26 const EXCEPTION_ON_INVALID_REFERENCE = 1; | |
27 const NULL_ON_INVALID_REFERENCE = 2; | |
28 const IGNORE_ON_INVALID_REFERENCE = 3; | |
29 | |
30 /** | |
31 * Sets a service. | |
32 * | |
33 * @param string $id The service identifier | |
34 * @param object $service The service instance | |
35 */ | |
36 public function set($id, $service); | |
37 | |
38 /** | |
39 * Gets a service. | |
40 * | |
41 * @param string $id The service identifier | |
42 * @param int $invalidBehavior The behavior when the service does not exist | |
43 * | |
44 * @return object The associated service | |
45 * | |
46 * @throws ServiceCircularReferenceException When a circular reference is detected | |
47 * @throws ServiceNotFoundException When the service is not defined | |
48 * | |
49 * @see Reference | |
50 */ | |
51 public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); | |
52 | |
53 /** | |
54 * Returns true if the given service is defined. | |
55 * | |
56 * @param string $id The service identifier | |
57 * | |
58 * @return bool true if the service is defined, false otherwise | |
59 */ | |
60 public function has($id); | |
61 | |
62 /** | |
63 * Check for whether or not a service has been initialized. | |
64 * | |
65 * @param string $id | |
66 * | |
67 * @return bool true if the service has been initialized, false otherwise | |
68 */ | |
69 public function initialized($id); | |
70 | |
71 /** | |
72 * Gets a parameter. | |
73 * | |
74 * @param string $name The parameter name | |
75 * | |
76 * @return mixed The parameter value | |
77 * | |
78 * @throws InvalidArgumentException if the parameter is not defined | |
79 */ | |
80 public function getParameter($name); | |
81 | |
82 /** | |
83 * Checks if a parameter exists. | |
84 * | |
85 * @param string $name The parameter name | |
86 * | |
87 * @return bool The presence of parameter in container | |
88 */ | |
89 public function hasParameter($name); | |
90 | |
91 /** | |
92 * Sets a parameter. | |
93 * | |
94 * @param string $name The parameter name | |
95 * @param mixed $value The parameter value | |
96 */ | |
97 public function setParameter($name, $value); | |
98 } |