Skip to content

Commit

Permalink
Fixing a Deprecated issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Power2All committed Jul 21, 2023
1 parent ae58192 commit c2a0fb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
}
],
"require": {
"php": ">=5.3.0"
"php": ">=5.3.0",
"ext-ctype": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.7"
Expand Down
8 changes: 5 additions & 3 deletions src/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ private function doDecode()
return $this->decodeDict();

default:
if (ctype_digit($this->getChar())) {
return $this->decodeString();
$character = $this->getChar();
if (is_string($character)) {
if (ctype_digit($character)) {
return $this->decodeString();
}
}

}

throw new RuntimeException("Unknown entity found at offset $this->offset");
Expand Down

0 comments on commit c2a0fb9

Please sign in to comment.