Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.675 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 2 | public function process(ContainerBuilder $container) |
|
17 | { |
||
18 | 2 | if (!$container->has('serializer') || $container->hasAlias('serializer')) { |
|
19 | |||
20 | 1 | return; |
|
21 | } |
||
22 | |||
23 | 1 | $class = $container->getDefinition('serializer')->getClass(); |
|
24 | |||
25 | 1 | if ('%serializer.class%' === $class) { |
|
26 | // 2.x Definition |
||
27 | $class = $container->getParameter($class); |
||
28 | } |
||
29 | |||
30 | 1 | if (!in_array(SerializerInterface::class, class_implements($class), true)) { |
|
31 | |||
32 | return; |
||
33 | } |
||
34 | 1 | } |
|
35 | } |
||
36 |