1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace Mdanter\Ecc\Exception; |
||
5 | |||
6 | use Throwable; |
||
7 | |||
8 | class UnsupportedCurveException extends \RuntimeException |
||
9 | { |
||
10 | /** |
||
11 | * @var null|string |
||
12 | */ |
||
13 | private $oid; |
||
14 | |||
15 | /** |
||
16 | * @var null|string |
||
17 | */ |
||
18 | private $curveName; |
||
19 | |||
20 | public function __construct(string $message = "", int $code = 0, Throwable $previous = null) |
||
21 | { |
||
22 | parent::__construct($message, $code, $previous); |
||
23 | } |
||
24 | |||
25 | public function setCurveName(string $curveName) |
||
26 | { |
||
27 | $this->curveName = $curveName; |
||
28 | return $this; |
||
29 | } |
||
30 | |||
31 | public function setOid(string $oid) |
||
32 | { |
||
33 | $this->oid = $oid; |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | public function hasCurveName(): bool |
||
38 | { |
||
39 | return is_string($this->curveName); |
||
40 | } |
||
41 | |||
42 | public function hasOid(): bool |
||
43 | { |
||
44 | return is_string($this->oid); |
||
45 | } |
||
46 | |||
47 | public function getCurveName(): string |
||
48 | { |
||
49 | return $this->curveName; |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
50 | } |
||
51 | |||
52 | public function getOid(): string |
||
53 | { |
||
54 | return $this->oid; |
||
0 ignored issues
–
show
|
|||
55 | } |
||
56 | } |
||
57 |