Passed
Pull Request — master (#1104)
by Maxim
12:14
created

InvalidRequestScopeException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Bootloader\Http\Exception;
6
7
use Psr\Http\Message\ServerRequestInterface;
8
use Spiral\Core\Container;
9
use Spiral\Core\Exception\Shared\InvalidContainerScopeException;
10
use Spiral\Framework\Spiral;
11
12
/**
13
 * The requested class depends on the {@see ServerRequestInterface} context which is not available in the
14
 * current container scope.
15
 * The {@see ServerRequestInterface} is usually available in the {@see Spiral::Http} or {@see Spiral::HttpRequest}
16
 * scopes.
17
 */
18
final class InvalidRequestScopeException extends InvalidContainerScopeException
19
{
20 3
    public function __construct(
21
        string $id,
22
        string|Container|null $scopeOrContainer = null,
23
    ) {
24 3
        parent::__construct($id, $scopeOrContainer, Spiral::Http->value);
25
    }
26
}
27