Completed
Push — 3.0 ( e1a49c...22c312 )
by Alexander
13:27
created

CircularReferenceException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getName() 0 4 1
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\di;
9
10
use yii\base\InvalidConfigException;
11
12
/**
13
 * NotInstantiableException is thrown when container tries to resolve
14
 * object having circular reference in configuration.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 * @since 3.0.0
18
 */
19
class CircularReferenceException extends InvalidConfigException
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 2
    public function __construct($class, $message = null, $code = 0, \Exception $previous = null)
25
    {
26 2
        if ($message === null) {
27 2
            $message = "Circular reference in $class.";
28
        }
29 2
        parent::__construct($message, $code, $previous);
30 2
    }
31
32
    /**
33
     * @return string the user-friendly name of this exception
34
     */
35
    public function getName()
36
    {
37
        return 'Circular reference';
38
    }
39
}
40