Making PHPStan happy
This commit is contained in:
parent
a88f703367
commit
81adf6af0a
10
json.inc.php
10
json.inc.php
|
@ -105,7 +105,7 @@ class JsonParser
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $input JSON string
|
* @param string $input JSON string
|
||||||
* @return null|ParsingException null if no error is found, a ParsingException containing all details otherwise
|
* @return null|JsonParsingException null if no error is found, a ParsingException containing all details otherwise
|
||||||
*/
|
*/
|
||||||
public function lint($input)
|
public function lint($input)
|
||||||
{
|
{
|
||||||
|
@ -114,12 +114,13 @@ class JsonParser
|
||||||
} catch (JsonParsingException $e) {
|
} catch (JsonParsingException $e) {
|
||||||
return $e;
|
return $e;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $input JSON string
|
* @param string $input JSON string
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws ParsingException
|
* @throws JsonParsingException
|
||||||
*/
|
*/
|
||||||
public function parse($input, $flags = 0)
|
public function parse($input, $flags = 0)
|
||||||
{
|
{
|
||||||
|
@ -289,7 +290,7 @@ class JsonParser
|
||||||
'first_column' => $this->lstack[count($this->lstack) - ($len ?: 1)]['first_column'],
|
'first_column' => $this->lstack[count($this->lstack) - ($len ?: 1)]['first_column'],
|
||||||
'last_column' => $this->lstack[count($this->lstack) - 1]['last_column'],
|
'last_column' => $this->lstack[count($this->lstack) - 1]['last_column'],
|
||||||
);
|
);
|
||||||
$r = $this->performAction($yyval, $yytext, $yyleng, $yylineno, $action[1], $this->vstack, $this->lstack);
|
$r = $this->performAction($yyval, $yytext, $yyleng, $yylineno, $action[1], $this->vstack);
|
||||||
|
|
||||||
if (!$r instanceof JsonUndefined) {
|
if (!$r instanceof JsonUndefined) {
|
||||||
return $r;
|
return $r;
|
||||||
|
@ -311,8 +312,6 @@ class JsonParser
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseError($str, $hash)
|
protected function parseError($str, $hash)
|
||||||
|
@ -664,7 +663,6 @@ class JsonLexer
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return 6;
|
return 6;
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
$this->yytext = substr($this->yytext, 1, $this->yyleng-2);
|
$this->yytext = substr($this->yytext, 1, $this->yyleng-2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue