From c8c981d9b316fd28f67a47cfbfe4f124d87b17b0 Mon Sep 17 00:00:00 2001 From: smiley Date: Sat, 23 Jul 2022 03:32:24 +0200 Subject: [PATCH] :octocat: Number::parseInt(): unnecessary throw as the string is validated at this point --- src/Data/Number.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Data/Number.php b/src/Data/Number.php index 34865ef14..49ef24ddf 100644 --- a/src/Data/Number.php +++ b/src/Data/Number.php @@ -91,18 +91,11 @@ final class Number extends QRDataModeAbstract{ /** * get the code for the given numeric string - * - * @throws \chillerlan\QRCode\Data\QRCodeDataException on an illegal character occurence */ - protected function parseInt(string $string):int{ + private function parseInt(string $string):int{ $num = 0; foreach(str_split($string) as $chr){ - - if(!isset(self::NUMBER_TO_ORD[$chr])){ - throw new QRCodeDataException(sprintf('illegal char: "%s"', $chr)); - } - $num = $num * 10 + ord($chr) - 48; }