Passed
Push — master ( 37709b...f45e89 )
by Aleksei
06:22 queued 17s
created

RecursiveProxyException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Exception\Container;
6
7
/**
8
 * Recursion can occur due to improper container configuration or
9
 * an unplanned exit from the scope by the execution thread.
10
 */
11
class RecursiveProxyException extends ContainerException
12
{
13 2
    public function __construct(
14
        public readonly string $alias,
15
        public readonly ?string $bindingScope = null,
16
        public readonly ?array $callingScope = null,
17
    ) {
18 2
        $message = "Recursive proxy detected for `$alias`.";
19 2
        $bindingScope === null or $message .= "\nBinding scope: `$bindingScope`.";
20 2
        $callingScope === null or $message .= "\nCalling scope: `" . \implode('.', $callingScope) . '`.';
21 2
        parent::__construct($message);
22
    }
23
}
24