Issues (2)

src/Common/SecurityContext.php (2 issues)

1
<?php
2
3
namespace EasyHttp\LayerContracts\Common;
4
5
use EasyHttp\LayerContracts\Contracts\Request\HttpSecurityContext;
6
7
class SecurityContext implements HttpSecurityContext
8
{
9
    protected string $certificate;
10
    protected string $privateKey;
11
12 1
    public function getCertificate(): string
13
    {
14 1
        return $this->certificate;
15
    }
16
17 1
    public function getPrivateKey(): string
18
    {
19 1
        return $this->privateKey;
20
    }
21
22 1
    public function hasCertificate(): bool
23
    {
24 1
        return $this->certificate ?? false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->certificate ?? false could return the type string which is incompatible with the type-hinted return boolean. Consider adding an additional type-check to rule them out.
Loading history...
25
    }
26
27 1
    public function hasPrivateKey(): bool
28
    {
29 1
        return $this->privateKey ?? false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->privateKey ?? false could return the type string which is incompatible with the type-hinted return boolean. Consider adding an additional type-check to rule them out.
Loading history...
30
    }
31
32 1
    public function setCertificate(string $certificate): self
33
    {
34 1
        $this->certificate = $certificate;
35
36 1
        return $this;
37
    }
38
39 1
    public function setPrivateKey(string $privateKey): self
40
    {
41 1
        $this->privateKey = $privateKey;
42
43 1
        return $this;
44
    }
45
}
46