@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | class EncodingException extends InvalidArgumentException |
| 13 | 13 | { |
| 14 | 14 | /** |
| 15 | - * @var mixed Value that caused this exception to be thrown |
|
| 16 | - */ |
|
| 15 | + * @var mixed Value that caused this exception to be thrown |
|
| 16 | + */ |
|
| 17 | 17 | protected $value; |
| 18 | 18 | |
| 19 | 19 | public function __construct(string $message, $value) |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * Return the value that caused this exception to be thrown |
|
| 27 | - * |
|
| 28 | - * @return mixed |
|
| 29 | - */ |
|
| 26 | + * Return the value that caused this exception to be thrown |
|
| 27 | + * |
|
| 28 | + * @return mixed |
|
| 29 | + */ |
|
| 30 | 30 | public function getValue() |
| 31 | 31 | { |
| 32 | 32 | return $this->value; |
@@ -17,23 +17,23 @@ discard block |
||
| 17 | 17 | class Decoder |
| 18 | 18 | { |
| 19 | 19 | /** |
| 20 | - * @var string Bencoded string being decoded |
|
| 21 | - */ |
|
| 20 | + * @var string Bencoded string being decoded |
|
| 21 | + */ |
|
| 22 | 22 | protected string $bencoded; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * @var int Length of the bencoded string |
|
| 26 | - */ |
|
| 25 | + * @var int Length of the bencoded string |
|
| 26 | + */ |
|
| 27 | 27 | protected int $len; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * @var int Safe rightmost boundary |
|
| 31 | - */ |
|
| 30 | + * @var int Safe rightmost boundary |
|
| 31 | + */ |
|
| 32 | 32 | protected int $max; |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @var int Position of the cursor while decoding |
|
| 36 | - */ |
|
| 35 | + * @var int Position of the cursor while decoding |
|
| 36 | + */ |
|
| 37 | 37 | protected int $offset; |
| 38 | 38 | |
| 39 | 39 | public static function decode(string $bencoded) |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * Check the cursor's position after decoding is done |
|
| 77 | - */ |
|
| 76 | + * Check the cursor's position after decoding is done |
|
| 77 | + */ |
|
| 78 | 78 | protected function checkCursorPosition(): void |
| 79 | 79 | { |
| 80 | 80 | if ($this->offset !== $this->len) |
@@ -94,10 +94,10 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * Adjust the rightmost boundary to the last safe character that can start a value |
|
| 98 | - * |
|
| 99 | - * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
| 100 | - */ |
|
| 97 | + * Adjust the rightmost boundary to the last safe character that can start a value |
|
| 98 | + * |
|
| 99 | + * Will rewind the boundary to skip the rightmost digits, optionally preceded by "i" or "i-" |
|
| 100 | + */ |
|
| 101 | 101 | protected function computeSafeBoundary(): void |
| 102 | 102 | { |
| 103 | 103 | $boundary = $this->len - 1; |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
| 254 | - * @throws PrematureEndOfData |
|
| 255 | - */ |
|
| 254 | + * @throws PrematureEndOfData |
|
| 255 | + */ |
|
| 256 | 256 | protected function prematureEndOfDataError(): void |
| 257 | 257 | { |
| 258 | 258 | throw new PrematureEndOfData(max(0, $this->len - 1)); |