Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Spatie\FlareClient\Http;
4
 
5
class Response
6
{
7
    protected mixed $headers;
8
 
9
    protected mixed $body;
10
 
11
    protected mixed $error;
12
 
13
    public function __construct(mixed $headers, mixed $body, mixed $error)
14
    {
15
        $this->headers = $headers;
16
 
17
        $this->body = $body;
18
 
19
        $this->error = $error;
20
    }
21
 
22
    public function getHeaders(): mixed
23
    {
24
        return $this->headers;
25
    }
26
 
27
    public function getBody(): mixed
28
    {
29
        return $this->body;
30
    }
31
 
32
    public function hasBody(): bool
33
    {
34
        return $this->body != false;
35
    }
36
 
37
    public function getError(): mixed
38
    {
39
        return $this->error;
40
    }
41
 
42
    public function getHttpResponseCode(): ?int
43
    {
44
        if (! isset($this->headers['http_code'])) {
45
            return null;
46
        }
47
 
48
        return (int) $this->headers['http_code'];
49
    }
50
}