Skip to content

Commit a08d59a

Browse files
committed
Fix PHPStan error in decodeEightBits by using pack
1 parent 1c1a6dc commit a08d59a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Base32.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function decode(string $input): string
201201
*
202202
* @return string parted decoded string
203203
*/
204-
private function decodeFlippedMap(int $i, array $input)
204+
private function decodeFlippedMap(int $i, array $input): string
205205
{
206206
$x = '';
207207

@@ -223,12 +223,12 @@ private function decodeFlippedMap(int $i, array $input)
223223
*
224224
* @return string
225225
*/
226-
private function decodeEightBits(int $bitCount, array $eightBits)
226+
private function decodeEightBits(int $bitCount, array $eightBits): string
227227
{
228228
$binaryString = '';
229229

230230
for ($z = 0; $z < $bitCount; $z++) {
231-
$binaryString .= (($y = chr((int)base_convert($eightBits[$z], 2, 10))) || ord($y) === 48) ? $y : '';
231+
$binaryString .= pack('C', bindec($eightBits[$z]));
232232
}
233233

234234
return $binaryString;

0 commit comments

Comments
 (0)