From e3e100af7ad31a2f58ca76f7b8915b303ee077ca Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Sun, 1 Sep 2019 20:08:18 +0300 Subject: [PATCH] fix php 7.4 deprecations --- lib/Common/BitMatrix.php | 2 +- lib/Qrcode/Decoder/DecodedBitStreamParser.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Common/BitMatrix.php b/lib/Common/BitMatrix.php index 112862d..dec4509 100644 --- a/lib/Common/BitMatrix.php +++ b/lib/Common/BitMatrix.php @@ -39,7 +39,7 @@ public static function parse($stringRepresentation, $setString, $unsetString) $nRows = 0; $pos = 0; while ($pos < strlen($stringRepresentation)) { - if ($stringRepresentation{$pos} == '\n' || + if ($stringRepresentation[$pos] == '\n' || $stringRepresentation->{$pos} == '\r') { if ($bitsPos > $rowStartPos) { if ($rowLength == -1) { diff --git a/lib/Qrcode/Decoder/DecodedBitStreamParser.php b/lib/Qrcode/Decoder/DecodedBitStreamParser.php index 75e5942..a0afdf4 100644 --- a/lib/Qrcode/Decoder/DecodedBitStreamParser.php +++ b/lib/Qrcode/Decoder/DecodedBitStreamParser.php @@ -266,8 +266,8 @@ private static function decodeAlphanumericSegment($bits, if ($fc1InEffect) { // We need to massage the result a bit if in an FNC1 mode: for ($i = $start; $i < strlen($result); $i++) { - if ($result{$i} == '%') { - if ($i < strlen($result) - 1 && $result{$i + 1} == '%') { + if ($result[$i] == '%') { + if ($i < strlen($result) - 1 && $result[$i + 1] == '%') { // %% is rendered as % $result = substr_replace($result, '', $i + 1, 1);//deleteCharAt(i + 1); } else {