diff --git a/src/Keys/AsymmetricPublicKey.php b/src/Keys/AsymmetricPublicKey.php index b6fa46dd..3ba57f61 100644 --- a/src/Keys/AsymmetricPublicKey.php +++ b/src/Keys/AsymmetricPublicKey.php @@ -48,6 +48,7 @@ public function __construct( /** * @return string + * @throws \TypeError */ public function encode(): string { @@ -56,7 +57,10 @@ public function encode(): string /** * @param string $encoded + * * @return self + * @throws \Exception + * @throws \TypeError */ public static function fromEncodedString(string $encoded): self { diff --git a/src/Keys/AsymmetricSecretKey.php b/src/Keys/AsymmetricSecretKey.php index 5064d2f4..670eb6f3 100644 --- a/src/Keys/AsymmetricSecretKey.php +++ b/src/Keys/AsymmetricSecretKey.php @@ -82,6 +82,7 @@ public static function generate(ProtocolInterface $protocol = null): self /** * @return string + * @throws \TypeError */ public function encode(): string { diff --git a/src/ProtocolCollection.php b/src/ProtocolCollection.php index cba89b23..d3c63e3c 100644 --- a/src/ProtocolCollection.php +++ b/src/ProtocolCollection.php @@ -47,6 +47,7 @@ public function __construct(ProtocolInterface ...$protocols) /** * Does the collection contain the given protocol + * @param ProtocolInterface $protocol * * @return bool */ @@ -89,7 +90,7 @@ public static function throwIfUnsupported(ProtocolInterface $protocol) */ public static function protocolFromHeader(string $header): ProtocolInterface { if (empty(self::$headerLookup)) { - /** @var string $protocolClass */ + /** @var ProtocolInterface $protocolClass */ foreach (self::WHITELIST as $protocolClass) { self::$headerLookup[$protocolClass::header()] = new $protocolClass; } @@ -106,6 +107,7 @@ public static function protocolFromHeader(string $header): ProtocolInterface { * Get a collection of all supported protocols * * @return self + * @throws InvalidVersionException */ public static function default(): self { @@ -123,6 +125,7 @@ function (string $p): ProtocolInterface { * Get a collection containing protocol version 1. * * @return self + * @throws InvalidVersionException */ public static function v1(): self { @@ -133,6 +136,7 @@ public static function v1(): self * Get a collection containing protocol version 2. * * @return self + * @throws InvalidVersionException */ public static function v2(): self { diff --git a/src/Purpose.php b/src/Purpose.php index fb35dcd8..fa4bc819 100644 --- a/src/Purpose.php +++ b/src/Purpose.php @@ -80,6 +80,7 @@ public function __construct(string $rawString) * Create a local purpose. * * @return self + * @throws InvalidPurposeException */ public static function local(): self { @@ -90,6 +91,7 @@ public static function local(): self * Create a public purpose. * * @return self + * @throws InvalidPurposeException */ public static function public(): self { @@ -100,7 +102,9 @@ public static function public(): self * Given a SendingKey, retrieve the corresponding Purpose. * * @param SendingKey $key + * * @return self + * @throws InvalidPurposeException */ public static function fromSendingKey(SendingKey $key): self { @@ -117,7 +121,9 @@ public static function fromSendingKey(SendingKey $key): self * Given a ReceivingKey, retrieve the corresponding Purpose. * * @param ReceivingKey $key + * * @return self + * @throws InvalidPurposeException */ public static function fromReceivingKey(ReceivingKey $key): self { @@ -133,7 +139,7 @@ public static function fromReceivingKey(ReceivingKey $key): self /** * Compare the instance with $purpose in constant time. * - * @param self $Purpose + * @param self $purpose * @return bool */ public function equals(self $purpose): bool