Making PHPStan happy

This commit is contained in:
Pavel Shevaev 2023-08-16 14:13:26 +03:00
parent 1961d423a7
commit a88f703367
2 changed files with 5 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tags

View File

@ -290,10 +290,11 @@ class jzonParser
++$this->c; ++$this->c;
} }
$str_num = substr($this->in, $start, $this->c - $start);
if($is_float) if($is_float)
$out = 1*substr($this->in, $start, $this->c - $start); $out = floatval($str_num);
else else
$out = (int)(1*substr($this->in, $start, $this->c - $start)); $out = intval($str_num);
} }
private function parse_true(&$out) private function parse_true(&$out)
@ -340,7 +341,7 @@ function jzon_parse($str)
return $res; return $res;
//NOTE: only allowing extension implementation if versions match //NOTE: only allowing extension implementation if versions match
if(JZON_EXT_VERSION === JZON_VERSION) if(defined('JZON_EXT_VERSION') && JZON_EXT_VERSION === JZON_VERSION)
{ {
list($ok, $err, $err_pos, $res) = jzon_parse_c($str); list($ok, $err, $err_pos, $res) = jzon_parse_c($str);
if(!$ok) if(!$ok)