| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function encapsulate(Container $container, $object, array $serviceConfig) |
||
| 11 | { |
||
| 12 | if (array_key_exists('interceptor', $serviceConfig)) { |
||
| 13 | foreach ($serviceConfig['interceptor'] as $interceptorName) { |
||
| 14 | $interceptor = $container->resolve($interceptorName); |
||
| 15 | |||
| 16 | if (! is_object($interceptor)) { |
||
| 17 | throw new \RuntimeException( |
||
| 18 | 'The interceptor ' . $interceptorName . ' does not reference a known service'); |
||
| 19 | } |
||
| 20 | |||
| 21 | $interceptor->setDecorated($object); |
||
| 22 | $object = $interceptor; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | return $object; |
||
| 27 | } |
||
| 28 | } |
||
| 29 |