• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lmc-eu / matej-client-php / 7527331519

15 Jan 2024 10:11AM UTC coverage: 100.0%. Remained the same
7527331519

Pull #135

github

web-flow
Merge 117257645 into 9666a6254
Pull Request #135: Update to new coding standard

20 of 21 new or added lines in 5 files covered. (95.24%)

400 existing lines in 23 files now uncovered.

758 of 758 relevant lines covered (100.0%)

18.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Exception/RequestException.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej\Exception;
4

5
use Http\Client\Exception;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8

9
/**
10
 * Generic exception thrown when error occurs during request execution.
11
 * Some more specific child exception could be thrown instead.
12
 */
13
class RequestException extends \RuntimeException implements MatejExceptionInterface, Exception
14
{
15
    /** @var RequestInterface */
16
    private $request;
17
    /** @var ResponseInterface */
18
    private $response;
19

20
    public function __construct(
21
        string $message,
22
        RequestInterface $request,
23
        ResponseInterface $response,
24
        \Throwable $previous = null
25
    ) {
UNCOV
26
        $code = $response->getStatusCode();
28✔
UNCOV
27
        $this->request = $request;
28✔
UNCOV
28
        $this->response = $response;
28✔
29

UNCOV
30
        parent::__construct($message, $code, $previous);
28✔
31
    }
7✔
32

33
    public function getRequest(): RequestInterface
34
    {
UNCOV
35
        return $this->request;
8✔
36
    }
37

38
    public function getResponse(): ResponseInterface
39
    {
UNCOV
40
        return $this->response;
8✔
41
    }
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc