| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function process(ContainerBuilder $container) |
||
| 23 | { |
||
| 24 | if (!$container->hasDefinition('sonata.media.thumbnail.format')) { |
||
| 25 | return; |
||
| 26 | } |
||
| 27 | |||
| 28 | $definition = $container->getDefinition( |
||
| 29 | 'sonata.media.thumbnail.format' |
||
| 30 | ); |
||
| 31 | |||
| 32 | $taggedServices = $container->findTaggedServiceIds( |
||
| 33 | 'sonata.media.resizer' |
||
| 34 | ); |
||
| 35 | |||
| 36 | foreach ($taggedServices as $id => $tags) { |
||
| 37 | $definition->addMethodCall( |
||
| 38 | 'addResizer', |
||
| 39 | [$id, new Reference($id)] |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |