| @@ 28-36 (lines=9) @@ | ||
| 25 | { |
|
| 26 | $ids = $container->findTaggedServiceIds(self::PAYMENT_METHOD_TAG); |
|
| 27 | ||
| 28 | foreach ($ids as $id => $tags) { |
|
| 29 | $def = $container->getDefinition($id); |
|
| 30 | $class = $container->getParameterBag()->resolveValue($def->getClass()); |
|
| 31 | if (!is_subclass_of($class, PaymentMethodInterface::class)) { |
|
| 32 | throw new \InvalidArgumentException( |
|
| 33 | sprintf('Service "%s" must implement interface "%s".', $id, PaymentMethodInterface::class)); |
|
| 34 | } |
|
| 35 | $def->setPublic(true); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 31-40 (lines=10) @@ | ||
| 28 | $queries = $container->getDefinition(Queries::class); |
|
| 29 | $ids = $container->findTaggedServiceIds(self::QUERY_CUSTOMIZER_TAG); |
|
| 30 | ||
| 31 | foreach ($ids as $id => $tags) { |
|
| 32 | $def = $container->getDefinition($id); |
|
| 33 | $class = $container->getParameterBag()->resolveValue($def->getClass()); |
|
| 34 | if (!is_subclass_of($class, QueryCustomizer::class)) { |
|
| 35 | throw new \InvalidArgumentException( |
|
| 36 | sprintf('Service "%s" must implement interface "%s".', $id, QueryCustomizer::class)); |
|
| 37 | } |
|
| 38 | ||
| 39 | $queries->addMethodCall('addCustomizer', [new Reference($id)]); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||