BadConfigurationException::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Yokai\MessengerBundle\Exception;
4
5
use InvalidArgumentException;
6
use Symfony\Component\OptionsResolver\Exception\ExceptionInterface as OptionsResolverException;
7
8
/**
9
 * @author Yann Eugoné <[email protected]>
10
 */
11
class BadConfigurationException extends InvalidArgumentException implements ExceptionInterface
12
{
13
    /**
14
     * @param OptionsResolverException $previous
15
     *
16
     * @return BadConfigurationException
17
     */
18 4
    public static function create(OptionsResolverException $previous)
19
    {
20 4
        return new self(
21 4
            sprintf(
22 4
                'The provided configuration is invalid. Exception : %s - %s',
23 4
                get_class($previous),
24 4
                $previous->getMessage()
25
            ),
26 4
            0,
27 4
            $previous
28
        );
29
    }
30
}
31