[TOOLS] Fix errors reported by PHPStan at level 4

This commit is contained in:
2021-12-26 22:17:26 +00:00
parent edd996d281
commit b84315c95b
19 changed files with 75 additions and 66 deletions

View File

@@ -79,16 +79,16 @@ abstract class Parser
$note_res = null;
$actor_res = null;
Event::handle('SearchCreateExpression', [$eb, $term, $language, $actor, &$note_res, &$actor_res]);
if (\is_null($note_res) && \is_null($actor_res)) {
if (\is_null($note_res) && \is_null($actor_res)) { // @phpstan-ignore-line
throw new ServerException("No one claimed responsibility for a match term: {$term}");
}
if (!\is_null($note_res) && !empty($note_res)) {
if (!\is_null($note_res) && !empty($note_res)) { // @phpstan-ignore-line
if (\is_array($note_res)) {
$note_res = $eb->orX(...$note_res);
}
$note_parts[] = $note_res;
}
if (!\is_null($actor_res) && !empty($note_res)) {
if (!\is_null($actor_res) && !empty($actor_res)) {
if (\is_array($actor_res)) {
$actor_res = $eb->orX(...$actor_res);
}
@@ -103,10 +103,11 @@ abstract class Parser
$last_op = $delimiter;
}
$match = true;
continue 2;
break;
}
}
if (!$match) {
// TODO
if (!$match) { // @phpstan-ignore-line
++$right;
}
}