From f316c2d58dec6a425ff177a3871a9ace6ee4022b Mon Sep 17 00:00:00 2001 From: Paul Rock Date: Sun, 28 Jun 2020 20:30:02 +0300 Subject: [PATCH] Preloading feature added to APILengthCoDec class --- src/APILengthCoDec.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/APILengthCoDec.php b/src/APILengthCoDec.php index 19d7a41..1ba8b41 100644 --- a/src/APILengthCoDec.php +++ b/src/APILengthCoDec.php @@ -3,8 +3,10 @@ namespace RouterOS; use DomainException; +use OverflowException; use RouterOS\Interfaces\StreamInterface; use RouterOS\Helpers\BinaryStringHelper; +use UnexpectedValueException; /** * class APILengthCoDec @@ -19,8 +21,6 @@ class APILengthCoDec /** * Encode string to length of string * - * <<<<<<< HEAD - * ======= * Encode the length: * - if length <= 0x7F (binary : 01111111 => 7 bits set to 1) * - encode length with one byte @@ -51,10 +51,9 @@ class APILengthCoDec * - end * - length > 0x7FFFFFFFFF : not supported * - * >>>>>>> master * @param int|float $length * - * @return string + * @return string */ public static function encodeLength($length): string { @@ -172,7 +171,7 @@ class APILengthCoDec // How can we test it ? // @codeCoverageIgnoreStart - throw new \OverflowException("Your system is using 32 bits integers, cannot decode this value ($firstByte) on this system"); + throw new OverflowException("Your system is using 32 bits integers, cannot decode this value ($firstByte) on this system"); // @codeCoverageIgnoreEnd } @@ -192,6 +191,6 @@ class APILengthCoDec // Now the only solution is 5 most significance bits are set to 1 (11111xxx) // This is a control word, not implemented by Mikrotik for the moment - throw new \UnexpectedValueException('Control Word found'); + throw new UnexpectedValueException('Control Word found'); } }