Completed
Pull Request — master (#127)
by Alexandr
04:00
created

Client::sendRequest()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Http;
6
7
use GuzzleHttp\Exception\GuzzleException;
8
use Psr\Http\Client\ClientInterface;
0 ignored issues
show
Bug introduced by
The type Psr\Http\Client\ClientInterface 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...
9
use Psr\Http\Message\RequestInterface;
10
use Psr\Http\Message\ResponseInterface;
11
12
class Client extends \GuzzleHttp\Client implements ClientInterface
13
{
14
    /**
15
     * @param RequestInterface $request
16
     *
17
     * @throws ClientException
18
     *
19
     * @return ResponseInterface
20
     */
21
    public function sendRequest(RequestInterface $request): ResponseInterface
22
    {
23
        try {
24
            return $this->send($request);
25
        } catch (GuzzleException $e) {
26
            throw new ClientException($e->getMessage(), $request, null, $e);
27
        }
28
    }
29
}
30