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

jomweb / billplz / 22912138050

10 Mar 2026 04:09PM UTC coverage: 73.745% (-23.8%) from 97.537%
22912138050

Pull #59

github

web-flow
Merge f68ad896b into 7e55fdd4e
Pull Request #59: Release Billplz 6.0 with Money objects, bundled Codex internals, and updated CI

263 of 443 new or added lines in 24 files covered. (59.37%)

3 existing lines in 2 files now uncovered.

514 of 697 relevant lines covered (73.74%)

24.87 hits per line

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

75.0
/src/Internal/Codex/Exceptions/HttpException.php
1
<?php
2

3
namespace Laravie\Codex\Exceptions;
4

5
use Exception;
6
use Http\Client\Exception as HttpClientException;
7
use InvalidArgumentException;
8
use Laravie\Codex\Contracts\Response;
9
use Psr\Http\Message\ResponseInterface;
10
use RuntimeException;
11

12
class HttpException extends RuntimeException implements HttpClientException
13
{
14
    /**
15
     * Response headers.
16
     *
17
     * @var \Psr\Http\Message\ResponseInterface|\Laravie\Codex\Contracts\Response
18
     */
19
    protected $response;
20

21
    /**
22
     * Construct a new HTTP exception.
23
     *
24
     * @param  \Psr\Http\Message\ResponseInterface|\Laravie\Codex\Contracts\Response  $response
25
     */
26
    public function __construct(
27
        $response,
28
        ?string $message = null,
29
        ?Exception $previous = null,
30
        int $code = 0
31
    ) {
32
        $this->setResponse($response);
2✔
33

34
        parent::__construct(
2✔
35
            $message ?: $response->getReasonPhrase(),
2✔
36
            ($code > 0) ? $code : $response->getStatusCode(),
2✔
37
            $previous
2✔
38
        );
2✔
39
    }
40

41
    /**
42
     * Get status code.
43
     */
44
    public function getStatusCode(): int
45
    {
NEW
46
        return $this->response->getStatusCode();
×
47
    }
48

49
    /**
50
     * Get response object.
51
     *
52
     * @return \Psr\Http\Message\ResponseInterface|\Laravie\Codex\Contracts\Response
53
     */
54
    public function getResponse()
55
    {
NEW
56
        return $this->response;
×
57
    }
58

59
    /**
60
     * Set response object.
61
     *
62
     * @param  \Psr\Http\Message\ResponseInterface|\Laravie\Codex\Contracts\Response  $response
63
     * @return $this
64
     *
65
     * @throws \InvalidArgumentException
66
     */
67
    final public function setResponse($response): self
68
    {
69
        if ($response instanceof Response || $response instanceof ResponseInterface) {
2✔
70
            $this->response = $response;
2✔
71

72
            return $this;
2✔
73
        }
74

NEW
75
        throw new InvalidArgumentException('$response is not an acceptable response object!');
×
76
    }
77
}
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

© 2026 Coveralls, Inc