Skip to content

Commit e2051f9

Browse files
committed
Added type hint to Encoder::encode
1 parent 9bfdf87 commit e2051f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Bencode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static function decodeNonCompliant(string $bencoded): ArrayObject|array|i
2121
return NonCompliantDecoder::decode($bencoded);
2222
}
2323

24-
public static function encode($value): string
24+
public static function encode(mixed $value): string
2525
{
2626
return Encoder::encode($value);
2727
}

src/Encoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class Encoder
1717
{
18-
public static function encode($value): string
18+
public static function encode(mixed $value): string
1919
{
2020
return match (gettype($value))
2121
{
@@ -43,7 +43,7 @@ protected static function coerceFloat(float $value): int
4343
throw new EncodingException('Unsupported value', $value);
4444
}
4545

46-
protected static function coerceUnsupportedValue($value): array|int|string
46+
protected static function coerceUnsupportedValue(mixed $value): array|int|string
4747
{
4848
return match (gettype($value))
4949
{

0 commit comments

Comments
 (0)