Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function createInstance(Container $container, $serviceName, array $serviceConfig) |
||
20 | { |
||
21 | if (! isset($serviceConfig['remote']) || ! isset($serviceConfig['class'])) { |
||
22 | throw new UnbuildableServiceException( |
||
23 | sprintf("No remote configuration available for service '%'.", $serviceName)); |
||
24 | } |
||
25 | |||
26 | $className = $serviceConfig['class']; |
||
27 | $remoteConfig = $serviceConfig['remote']; |
||
28 | $convertedRemoteConfig = ParamsResolver::resolveParams($container, $remoteConfig); |
||
29 | |||
30 | $adapter = $this->adapterFactory->getAdapter($serviceName, $convertedRemoteConfig); |
||
31 | $factory = new \ProxyManager\Factory\RemoteObjectFactory($adapter); |
||
32 | |||
33 | return $factory->createProxy($className); |
||
34 | } |
||
35 | } |
||
36 |