Making PHPStan happy

This commit is contained in:
Pavel Shevaev 2023-08-18 13:13:48 +03:00
parent a88f703367
commit 81adf6af0a
1 changed files with 4 additions and 6 deletions

View File

@ -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);