Skip to content

Commit

Permalink
fix php 7.4 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
andreybolonin committed Sep 1, 2019
1 parent 2660744 commit e3e100a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Common/BitMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Qrcode/Decoder/DecodedBitStreamParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e3e100a

Please sign in to comment.