Test Failed
Push — master ( 73c405...d57cd2 )
by Konstantins
03:14
created

CircularReferenceException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 18
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createMessage() 0 10 1
1
<?php declare(strict_types = 1);
2
3
namespace Venta\Container\Exception;
4
5
use Exception;
6
7
/**
8
 * Class CircularReferenceException
9
 *
10
 * @package Venta\Container\Exception
11
 */
12
class CircularReferenceException extends ContainerException
13
{
14
15
    /**
16
     * @inheritDoc
17
     */
18
    protected function createMessage(Exception $previous = null):string
19
    {
20
        // Adding the last dependency to the reflection path.
21
        $this->addToReferenceChain($this->serviceId());
22
        return sprintf(
23
            'Circular reference detected for "%s", path: "%s".',
24
            $this->serviceId(),
25
            implode(' -> ', $this->referenceChain())
26
        );
27
    }
28
29
}