Explorar o código

:shower: force int because PHP8.1 hates this

codemasher %!s(int64=4) %!d(string=hai) anos
pai
achega
cdd8aea40a
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      src/Data/AlphaNum.php
  2. 1 1
      src/Data/Kanji.php

+ 1 - 1
src/Data/AlphaNum.php

@@ -113,7 +113,7 @@ final class AlphaNum extends QRDataModeAbstract{
 			}
 			}
 
 
 			$nextTwoCharsBits = $bitBuffer->read(11);
 			$nextTwoCharsBits = $bitBuffer->read(11);
-			$result           .= $toAlphaNumericChar($nextTwoCharsBits / 45);
+			$result           .= $toAlphaNumericChar((int)($nextTwoCharsBits / 45));
 			$result           .= $toAlphaNumericChar($nextTwoCharsBits % 45);
 			$result           .= $toAlphaNumericChar($nextTwoCharsBits % 45);
 			$length           -= 2;
 			$length           -= 2;
 		}
 		}

+ 1 - 1
src/Data/Kanji.php

@@ -128,7 +128,7 @@ final class Kanji extends QRDataModeAbstract{
 		while($length > 0){
 		while($length > 0){
 			// Each 13 bits encodes a 2-byte character
 			// Each 13 bits encodes a 2-byte character
 			$twoBytes          = $bitBuffer->read(13);
 			$twoBytes          = $bitBuffer->read(13);
-			$assembledTwoBytes = (($twoBytes / 0x0c0) << 8) | ($twoBytes % 0x0c0);
+			$assembledTwoBytes = ((int)($twoBytes / 0x0c0) << 8) | ($twoBytes % 0x0c0);
 
 
 			$assembledTwoBytes += ($assembledTwoBytes < 0x01f00)
 			$assembledTwoBytes += ($assembledTwoBytes < 0x01f00)
 				? 0x08140  // In the 0x8140 to 0x9FFC range
 				? 0x08140  // In the 0x8140 to 0x9FFC range