@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Encode an array into either an array of a dictionary |
|
40 | - */ |
|
39 | + * Encode an array into either an array of a dictionary |
|
40 | + */ |
|
41 | 41 | protected static function encodeArray(array $value): string |
42 | 42 | { |
43 | 43 | if (empty($value)) |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Encode given ArrayObject instance into a dictionary |
|
59 | - */ |
|
58 | + * Encode given ArrayObject instance into a dictionary |
|
59 | + */ |
|
60 | 60 | protected static function encodeArrayObject(ArrayObject $dict): string |
61 | 61 | { |
62 | 62 | $vars = $dict->getArrayCopy(); |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Encode a scalar value |
|
77 | - */ |
|
76 | + * Encode a scalar value |
|
77 | + */ |
|
78 | 78 | protected static function encodeScalar($value): string |
79 | 79 | { |
80 | 80 | if (is_int($value) || is_float($value)) |
@@ -14,23 +14,23 @@ discard block |
||
14 | 14 | class Decoder |
15 | 15 | { |
16 | 16 | /** |
17 | - * @var string Bencoded string being decoded |
|
18 | - */ |
|
17 | + * @var string Bencoded string being decoded |
|
18 | + */ |
|
19 | 19 | protected string $bencoded; |
20 | 20 | |
21 | 21 | /** |
22 | - * @var int Length of the bencoded string |
|
23 | - */ |
|
22 | + * @var int Length of the bencoded string |
|
23 | + */ |
|
24 | 24 | protected int $len; |
25 | 25 | |
26 | 26 | /** |
27 | - * @var int Safe rightmost boundary |
|
28 | - */ |
|
27 | + * @var int Safe rightmost boundary |
|
28 | + */ |
|
29 | 29 | protected int $max; |
30 | 30 | |
31 | 31 | /** |
32 | - * @var int Position of the cursor while decoding |
|
33 | - */ |
|
32 | + * @var int Position of the cursor while decoding |
|
33 | + */ |
|
34 | 34 | protected int $pos; |
35 | 35 | |
36 | 36 | public static function decode(string $bencoded) |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | - * Check the cursor's position after decoding is done |
|
75 | - */ |
|
74 | + * Check the cursor's position after decoding is done |
|
75 | + */ |
|
76 | 76 | protected function checkCursorPosition(): void |
77 | 77 | { |
78 | 78 | if ($this->pos !== $this->len) |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | - * Adjust the rightmost boundary to the last safe character that can start a value |
|
96 | - * |
|
97 | - * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
98 | - */ |
|
95 | + * Adjust the rightmost boundary to the last safe character that can start a value |
|
96 | + * |
|
97 | + * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
98 | + */ |
|
99 | 99 | protected function computeSafeBoundary(): void |
100 | 100 | { |
101 | 101 | $boundary = $this->len - 1; |