@@ -15,23 +15,23 @@ discard block |
||
| 15 | 15 | class Bencode |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @var string Bencoded string being decoded |
|
| 19 | - */ |
|
| 18 | + * @var string Bencoded string being decoded |
|
| 19 | + */ |
|
| 20 | 20 | protected string $bencoded; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * @var int Length of the bencoded string |
|
| 24 | - */ |
|
| 23 | + * @var int Length of the bencoded string |
|
| 24 | + */ |
|
| 25 | 25 | protected int $len; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @var int Safe rightmost boundary |
|
| 29 | - */ |
|
| 28 | + * @var int Safe rightmost boundary |
|
| 29 | + */ |
|
| 30 | 30 | protected int $max; |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * @var int Position of the cursor while decoding |
|
| 34 | - */ |
|
| 33 | + * @var int Position of the cursor while decoding |
|
| 34 | + */ |
|
| 35 | 35 | protected int $pos; |
| 36 | 36 | |
| 37 | 37 | protected function __construct(string $bencoded) |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Adjust the rightmost boundary to the last safe character |
|
| 111 | - * |
|
| 112 | - * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
| 113 | - */ |
|
| 110 | + * Adjust the rightmost boundary to the last safe character |
|
| 111 | + * |
|
| 112 | + * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
| 113 | + */ |
|
| 114 | 114 | protected function computeSafeBoundary(): void |
| 115 | 115 | { |
| 116 | 116 | $boundary = $this->len - 1; |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | - * Encode an array into either an array of a dictionary |
|
| 260 | - */ |
|
| 259 | + * Encode an array into either an array of a dictionary |
|
| 260 | + */ |
|
| 261 | 261 | protected static function encodeArray(array $value): string |
| 262 | 262 | { |
| 263 | 263 | if (empty($value)) |
@@ -275,8 +275,8 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | - * Encode given ArrayObject instance into a dictionary |
|
| 279 | - */ |
|
| 278 | + * Encode given ArrayObject instance into a dictionary |
|
| 279 | + */ |
|
| 280 | 280 | protected static function encodeArrayObject(ArrayObject $dict): string |
| 281 | 281 | { |
| 282 | 282 | $vars = $dict->getArrayCopy(); |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
| 296 | - * Encode a scalar value |
|
| 297 | - */ |
|
| 296 | + * Encode a scalar value |
|
| 297 | + */ |
|
| 298 | 298 | protected static function encodeScalar($value): string |
| 299 | 299 | { |
| 300 | 300 | if (is_int($value) || is_float($value) || is_bool($value)) |