Fix phpstan issues (or ignore them).

This commit is contained in:
James Cole
2025-02-09 07:02:12 +01:00
parent f909f1d9ff
commit 6172d60e00
14 changed files with 23 additions and 18 deletions

View File

@@ -63,13 +63,9 @@ abstract class Node
return false;
}
if ($compare instanceof NodeGroup) {
if ($compare instanceof NodeGroup && $this instanceof NodeGroup) {
if (count($compare->getNodes()) !== count($this->getNodes())) {
Log::debug(sprintf('Return false because node count is different. Original is %d, compare is %d', count($this->getNodes()), count($compare->getNodes())));
// var_dump($this);
// var_dump($compare);
// exit;
return false;
}
@@ -80,11 +76,6 @@ abstract class Node
foreach ($this->getNodes() as $index => $node) {
if (false === $node->equals($compare->getNodes()[$index])) {
Log::debug('Return false because nodes are different!');
var_dump($this);
var_dump($compare);
exit;
return false;
}
}

View File

@@ -152,12 +152,12 @@ class QueryParser implements QueryParserInterface
case ':':
$skipNext = false;
if ('' === $tokenUnderConstruction) { // @phpstan-ignore-line
if ('' === $tokenUnderConstruction) {
// In any other location, it's just a normal character
$tokenUnderConstruction .= $char;
$skipNext = true;
}
if ('' !== $tokenUnderConstruction && !$skipNext) {
if ('' !== $tokenUnderConstruction && !$skipNext) { // @phpstan-ignore-line
Log::debug(sprintf('Turns out that "%s" is a field name. Reset the token.', $tokenUnderConstruction));
// If we meet a colon with a left-hand side string, we know we're in a field and are about to set up the value
$fieldName = $tokenUnderConstruction;

View File

@@ -114,7 +114,7 @@ class AmountFormat extends AbstractExtension
static function (string $amount, string $code, ?bool $coloured = null): string {
$coloured ??= true;
/** @var TransactionCurrency $currency */
/** @var TransactionCurrency|null $currency */
$currency = TransactionCurrency::whereCode($code)->first();
if (null === $currency) {
Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code));