Skip to content

Commit 4839e66

Browse files
committed
Code cleanup
- Add missing return type - Remove unneeded doc-blocks - Add missing param in doc-block
1 parent 36144c5 commit 4839e66

2 files changed

Lines changed: 8 additions & 21 deletions

File tree

src/Config/Keys.php

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

src/Utils/Jwks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final public function __toString() : string
2626
return (string) json_encode($this);
2727
}
2828

29-
final public function jsonSerialize()
29+
final public function jsonSerialize(): array
3030
{
3131
return $this->create();
3232
}

0 commit comments

Comments
 (0)