Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 3 | public function __construct( |
|
18 | protected readonly string $id, |
||
19 | Container|string|null $scopeOrContainer = null, |
||
20 | protected readonly ?string $requiredScope = null, |
||
21 | ) { |
||
22 | 3 | $this->scope = \is_string($scopeOrContainer) |
|
23 | ? $scopeOrContainer |
||
24 | 3 | : Introspector::scopeName($scopeOrContainer); |
|
25 | |||
26 | 3 | $req = $this->requiredScope !== null ? ", `$this->requiredScope` is required" : ''; |
|
27 | |||
28 | 3 | parent::__construct("Unable to resolve `$id` in the `$this->scope` scope{$req}."); |
|
29 | } |
||
31 |