Completed
Push — master ( 5644ae...21573f )
by Lukas Kahwe
04:43
created

ConfigurationCheckPass::process()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4286
cc 3
eloc 3
nc 2
nop 1
crap 3
1
<?php
2
3
/*
4
 * This file is part of the FOSRestBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\RestBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Checks if the SensioFrameworkExtraBundle views annotations are disabled when using the View Response listener.
19
 *
20
 * @author Eriksen Costa <[email protected]>
21
 *
22
 * @internal
23
 */
24
final class ConfigurationCheckPass implements CompilerPassInterface
25
{
26 7
    public function process(ContainerBuilder $container)
27
    {
28 7
        if ($container->has('fos_rest.converter.request_body') && !$container->has('sensio_framework_extra.converter.listener')) {
29 1
            throw new \RuntimeException('You need to enable the parameter converter listeners in SensioFrameworkExtraBundle when using the FOSRestBundle RequestBodyParamConverter');
30
        }
31 6
    }
32
}
33