Skip to content

Commit c627e83

Browse files
authored
add typing to private methods
1 parent e525e0a commit c627e83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/JWK.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public static function parseKey(array $jwk): ?Key
152152
* @param string $oid the OID string
153153
* @return string the binary DER-encoded OID
154154
*/
155-
private static function encodeOID($oid)
155+
private static function encodeOID(string $oid): string
156156
{
157157
$octets = explode('.', $oid);
158158

@@ -229,7 +229,7 @@ private static function ecJwkToPem($oid, $x, $y)
229229
* @param string $value the value to encode
230230
* @return string the encoded object
231231
*/
232-
private static function encodeDER($type, $value)
232+
private static function encodeDER(int $type, string $value): string
233233
{
234234
$tag_header = 0;
235235
if ($type === self::$asn1Sequence) {
@@ -255,7 +255,7 @@ private static function encodeDER($type, $value)
255255
*
256256
* @uses encodeLength
257257
*/
258-
private static function createPemFromModulusAndExponent($n, $e)
258+
private static function createPemFromModulusAndExponent(string $n, string $e): string
259259
{
260260
$modulus = JWT::urlsafeB64Decode($n);
261261
$publicExponent = JWT::urlsafeB64Decode($e);
@@ -301,7 +301,7 @@ private static function createPemFromModulusAndExponent($n, $e)
301301
* @param int $length
302302
* @return string
303303
*/
304-
private static function encodeLength($length)
304+
private static function encodeLength(int $length): string
305305
{
306306
if ($length <= 0x7F) {
307307
return \chr($length);

0 commit comments

Comments
 (0)