Passed
Push — master ( 71280b...e2ce25 )
by Dmitriy
03:33 queued 01:13
created

HttpClientInterfaceProxy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A sendRequest() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector;
6
7
use Psr\Http\Client\ClientInterface;
8
use Psr\Http\Message\RequestInterface;
9
use Psr\Http\Message\ResponseInterface;
10
11
final class HttpClientInterfaceProxy implements ClientInterface
12
{
13
    public function __construct(private ClientInterface $decorated, private HttpClientCollector $collector)
0 ignored issues
show
Bug introduced by
The type Yiisoft\Yii\Debug\Collector\HttpClientCollector was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
    {
15
    }
16
17
    public function sendRequest(RequestInterface $request): ResponseInterface
18
    {
19
        [$callStack] = debug_backtrace();
20
21
        $this->collector->collect($request, $callStack['file'] . ':' . $callStack['line']);
22
23
        try {
24
            return $this->decorated->sendRequest($request);
25
        } finally {
26
            $this->collector->collectTotalTime($request);
27
        }
28
    }
29
}
30