| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function __invoke(ContainerInterface $container, string $requestedName, array $options = null): WebProcessor |
||
| 31 | { |
||
| 32 | $options = $options ?? $this->getServiceOptions($container, $requestedName); |
||
| 33 | |||
| 34 | try { |
||
| 35 | return new WebProcessor( |
||
| 36 | $options['server_data'] ?? null, |
||
| 37 | $options['extra_fields'] ?? $this->defaultExtraFields |
||
| 38 | ); |
||
| 39 | } catch (\UnexpectedValueException $e) { |
||
| 40 | throw new ServiceNotCreatedException( |
||
| 41 | sprintf( |
||
| 42 | 'Failed to create web processor \'%s\': %s', |
||
| 43 | $requestedName, |
||
| 44 | $e->getMessage() |
||
| 45 | ), |
||
| 46 | $e->getCode(), |
||
| 47 | $e |
||
| 48 | ); |
||
| 52 |