@@ -10,44 +10,31 @@ class Keys
1010{
1111 ////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\
1212
13- /** @var string|CryptoKey */
14- private $ encryptionKey ;
15- /** @var CryptKey*/
16- private $ privateKey ;
17- /** @var Key */
18- private $ publicKey ;
13+ private string |CryptoKey $ encryptionKey ;
14+ private CryptKey $ privateKey ;
15+ private Key $ publicKey ;
1916
2017 //////////////////////////// GETTERS AND SETTERS \\\\\\\\\\\\\\\\\\\\\\\\\\\
2118
22- /** @return CryptoKey|string */
23- final public function getEncryptionKey ()
19+ final public function getEncryptionKey (): CryptoKey |string
2420 {
2521 return $ this ->encryptionKey ;
2622 }
2723
28- /** @return CryptKey */
29- final public function getPrivateKey () : CryptKey
24+ final public function getPrivateKey (): CryptKey
3025 {
3126 return $ this ->privateKey ;
3227 }
3328
34- /*** @return Key */
35- public function getPublicKey () : Key
29+ public function getPublicKey (): Key
3630 {
3731 return $ this ->publicKey ;
3832 }
3933
4034 //////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
4135
42- /**
43- * Keys constructor.
44- *
45- * @param CryptKey $privateKey
46- * @param string|CryptoKey $encryptionKey
47- */
48- final public function __construct (CryptKey $ privateKey , Key $ publicKey , $ encryptionKey )
36+ final public function __construct (CryptKey $ privateKey , Key $ publicKey , CryptoKey |string $ encryptionKey )
4937 {
50- // @FIXME: Add type-check for $encryptionKey (or an extending class with different parameter type?)
5138 $ this ->encryptionKey = $ encryptionKey ;
5239 $ this ->privateKey = $ privateKey ;
5340 $ this ->publicKey = $ publicKey ;
0 commit comments