1 | <?php |
||
10 | class ServiceManager extends \ArrayObject |
||
11 | { |
||
12 | /** |
||
13 | * @var \Guzzle\Common\Collection |
||
14 | */ |
||
15 | protected $config; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $removed = array(); |
||
21 | |||
22 | /** |
||
23 | * @var \Symfony\Component\Filesystem\Filesystem |
||
24 | */ |
||
25 | protected $filesystem; |
||
26 | |||
27 | /** |
||
28 | * @param array $config |
||
29 | */ |
||
30 | 48 | public function __construct(array $config = array()) |
|
45 | |||
46 | /** |
||
47 | * @return \Guzzle\Common\Collection |
||
48 | */ |
||
49 | 3 | public function getConfig() |
|
53 | |||
54 | /** |
||
55 | * @param \Symfony\Component\Filesystem\Filesystem $filesystem |
||
56 | * |
||
57 | * @return \Acquia\Rest\ServiceManager |
||
58 | */ |
||
59 | 3 | public function setFilesystem(Filesystem $filesystem) |
|
64 | |||
65 | /** |
||
66 | * @return \Symfony\Component\Filesystem\Filesystem |
||
67 | */ |
||
68 | 15 | public function getFilesystem() |
|
75 | |||
76 | /** |
||
77 | * @param string $group |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 30 | public function getConfigFilename($group) |
|
91 | |||
92 | /** |
||
93 | * @param string $name |
||
94 | * |
||
95 | * @return boolean |
||
96 | */ |
||
97 | 24 | public function hasConfigFile($name) |
|
102 | |||
103 | /** |
||
104 | * @param string $group |
||
105 | * |
||
106 | * @return \Guzzle\Service\Builder\ServiceBuilder |
||
107 | */ |
||
108 | 21 | public function load($group) |
|
113 | |||
114 | /** |
||
115 | * @param string $group |
||
116 | * |
||
117 | * @return \Guzzle\Service\Builder\ServiceBuilder |
||
118 | */ |
||
119 | 24 | public function offsetGet($group) |
|
135 | |||
136 | /** |
||
137 | * @param string $group |
||
138 | * @param \Guzzle\Service\Builder\ServiceBuilder $builder |
||
139 | */ |
||
140 | 27 | public function offsetSet($group, $builder) |
|
147 | |||
148 | /** |
||
149 | * @param string $group |
||
150 | */ |
||
151 | 9 | public function offsetUnset($group) |
|
156 | |||
157 | /** |
||
158 | * @param string $group |
||
159 | * |
||
160 | * @return \Guzzle\Service\Builder\ServiceBuilder |
||
161 | */ |
||
162 | 12 | public function getBuilder($group) |
|
166 | |||
167 | /** |
||
168 | * @param string $group |
||
169 | * @param \Guzzle\Service\Builder\ServiceBuilder $builder |
||
170 | * |
||
171 | * @return \Acquia\Rest\ServiceManager |
||
172 | */ |
||
173 | 6 | public function setBuilder($group, ServiceBuilder $builder) |
|
179 | |||
180 | /** |
||
181 | * @param string $group |
||
182 | * @param string $name |
||
183 | * @param \Guzzle\Service\Client $client |
||
184 | * |
||
185 | * @return \Acquia\Rest\ServiceManager |
||
186 | */ |
||
187 | 6 | public function setClient($group, $name, Client $client) |
|
213 | |||
214 | /** |
||
215 | * @param string $group |
||
216 | * @param string $name |
||
217 | * |
||
218 | * @return \Guzzle\Service\Client |
||
219 | */ |
||
220 | 6 | public function getClient($group, $name) |
|
224 | |||
225 | /** |
||
226 | * @param string $group |
||
227 | * @param string $name |
||
228 | * |
||
229 | * @return \Acquia\Rest\ServiceManager |
||
230 | */ |
||
231 | 3 | public function removeClient($group, $name) |
|
237 | |||
238 | /** |
||
239 | * Writes all service group configurations to the backend. |
||
240 | * |
||
241 | * @param boolean $overwrite |
||
242 | */ |
||
243 | 6 | public function save($overwrite = false) |
|
249 | |||
250 | /** |
||
251 | * @param string $group |
||
252 | * @param boolean $overwrite |
||
253 | * |
||
254 | * @throws \Symfony\Component\Filesystem\Exception\IOException |
||
255 | * |
||
256 | * @see http://guzzlephp.org/webservice-client/using-the-service-builder.html#sourcing-from-a-json-document |
||
257 | */ |
||
258 | 6 | public function saveServiceGroup($group, $overwrite = false) |
|
295 | |||
296 | /** |
||
297 | * @param string $group |
||
298 | * |
||
299 | * @throws \Symfony\Component\Filesystem\Exception\IOException |
||
300 | */ |
||
301 | 6 | public function deleteServiceGroup($group) |
|
314 | } |
||
315 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.