1 | <?php declare(strict_types=1); |
||
33 | abstract class BaseAsymmetricCrypt extends BaseCrypt |
||
34 | { |
||
35 | /** |
||
36 | * @var resource|null |
||
37 | */ |
||
38 | private $key = null; |
||
39 | |||
40 | /** |
||
41 | * @var int|null |
||
42 | */ |
||
43 | private $keyBytes = null; |
||
44 | |||
45 | /** |
||
46 | * Destructor. |
||
47 | */ |
||
48 | 5 | public function __destruct() |
|
52 | |||
53 | /** |
||
54 | * @return self |
||
55 | */ |
||
56 | 5 | public function closeKey(): self |
|
66 | |||
67 | /** |
||
68 | * @return resource|null |
||
69 | */ |
||
70 | 3 | protected function getKey() |
|
74 | |||
75 | /** |
||
76 | * @param resource $key |
||
77 | * |
||
78 | * @return self |
||
79 | */ |
||
80 | 5 | protected function setKey($key): self |
|
89 | |||
90 | /** |
||
91 | * @return int|null |
||
|
|||
92 | */ |
||
93 | 3 | protected function getKeyBytes(): ?int |
|
104 | |||
105 | /** |
||
106 | * @return int|null |
||
107 | */ |
||
108 | 3 | protected function getEncryptChunkSize(): ?int |
|
117 | |||
118 | /** |
||
119 | * @return int|null |
||
120 | */ |
||
121 | 3 | protected function getDecryptChunkSize(): ?int |
|
128 | |||
129 | /** |
||
130 | * @param string $value |
||
131 | * @param int $maxSize |
||
132 | * |
||
133 | * @return Generator |
||
134 | */ |
||
135 | 3 | protected function chunkString(string $value, int $maxSize): Generator |
|
153 | |||
154 | /** |
||
155 | * @param string $path |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | 5 | protected function checkIfPathToFileCheckPrefix(string $path): bool |
|
167 | } |
||
168 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.