| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 9 |
| Ratio | 64.29 % |
| Tests | 7 |
| CRAP Score | 3.0987 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 1 | public function process(ContainerBuilder $container) |
|
| 25 | { |
||
| 26 | 1 | $ids = $container->findTaggedServiceIds(self::PAYMENT_METHOD_TAG); |
|
| 27 | |||
| 28 | 1 | View Code Duplication | foreach ($ids as $id => $tags) { |
| 29 | 1 | $def = $container->getDefinition($id); |
|
| 30 | 1 | $class = $container->getParameterBag()->resolveValue($def->getClass()); |
|
| 31 | 1 | if (!is_subclass_of($class, PaymentMethodInterface::class)) { |
|
| 32 | throw new \InvalidArgumentException( |
||
| 33 | sprintf('Service "%s" must implement interface "%s".', $id, PaymentMethodInterface::class)); |
||
| 34 | } |
||
| 35 | 1 | $def->setPublic(true); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 |