1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace BEAR\Resource\SemanticLog\Profile\Compact; |
6
|
|
|
|
7
|
|
|
use BEAR\Resource\ResourceObject; |
8
|
|
|
use BEAR\Resource\Types; |
9
|
|
|
use Koriym\SemanticLogger\AbstractContext; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @psalm-import-type Headers from Types |
13
|
|
|
* @psalm-import-type HttpBody from Types |
14
|
|
|
*/ |
15
|
|
|
final class CompleteContext extends AbstractContext |
16
|
|
|
{ |
17
|
|
|
/** @psalm-suppress InvalidClassConstantType */ |
18
|
|
|
public const TYPE = 'bear_resource_complete'; |
19
|
|
|
|
20
|
|
|
/** @psalm-suppress InvalidClassConstantType */ |
21
|
|
|
public const SCHEMA_URL = 'https://bearsunday.github.io/BEAR.Resource/schemas/complete-context.json'; |
22
|
|
|
|
23
|
|
|
public readonly string $uri; |
24
|
|
|
public readonly int $code; |
25
|
|
|
|
26
|
|
|
/** @var Headers */ |
|
|
|
|
27
|
|
|
public readonly array $headers; |
28
|
|
|
|
29
|
|
|
/** @var HttpBody */ |
|
|
|
|
30
|
|
|
public readonly mixed $body; |
31
|
|
|
public readonly string $view; |
32
|
|
|
|
33
|
|
|
public function __construct(ResourceObject $resource, OpenContext $openContext) |
34
|
|
|
{ |
35
|
|
|
// Trigger rendering to get view |
36
|
|
|
$resourceString = (string) $resource; |
37
|
|
|
unset($resourceString); |
38
|
|
|
|
39
|
|
|
$this->uri = (string) $resource->uri; |
|
|
|
|
40
|
|
|
$this->code = $resource->code; |
|
|
|
|
41
|
|
|
$this->headers = $resource->headers; |
|
|
|
|
42
|
|
|
/** @psalm-suppress MixedAssignment */ |
43
|
|
|
/** @phpstan-ignore-next-line */ |
44
|
|
|
$this->body = $resource->body; |
|
|
|
|
45
|
|
|
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */ |
46
|
|
|
$this->view = $resource->view ?? ''; |
|
|
|
|
47
|
|
|
unset($openContext); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public static function create(ResourceObject $resource, OpenContext $openContext): self |
51
|
|
|
{ |
52
|
|
|
return new self($resource, $openContext); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths