Completed
Push — master ( ff0374...3c2b88 )
by Matthieu
02:06
created

InvalidDefinition::create()   A

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 8
Code Lines 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 9.4285
1
<?php
2
3
namespace DI\Definition\Exception;
4
5
use DI\Definition\Definition;
6
7
/**
8
 * Invalid DI definitions.
9
 *
10
 * @author Matthieu Napoli <[email protected]>
11
 */
12
class InvalidDefinition extends \Exception
13
{
14
    public static function create(Definition $definition, $message)
15
    {
16
        return new self(sprintf(
17
            '%s' . PHP_EOL . 'Full definition:' . PHP_EOL . '%s',
18
            $message,
19
            (string) $definition
20
        ));
21
    }
22
}
23