Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab committed Jan 7, 2022
1 parent 03e3762 commit 682b1d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,24 @@ private function clearNotNullBeforeCount(Class_ $class, array $propertyNames): v

$isNextNodeCountingProperty = (bool) $this->betterNodeFinder->findFirst($node->right, function (Node $node) use (
$propertyNames
): ?bool {
): bool {
if (! $node instanceof FuncCall) {
return null;
return false;
}

if (! $this->isName($node, 'count')) {
return null;
return false;
}

if (! $this->argsAnalyzer->isArgInstanceInArgsPosition($node->args, 0)) {
return null;
return false;
}

/** @var Arg $firstArg */
$firstArg = $node->args[0];
$countedArgument = $firstArg->value;
if (! $countedArgument instanceof PropertyFetch) {
return null;
return false;
}

return $this->isNames($countedArgument, $propertyNames);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ private function isProbablyMysql(Expr $expr): bool

private function findConnectionVariable(FuncCall $funcCall): ?Expr
{
$connectionAssign = $this->betterNodeFinder->findFirstPrevious($funcCall, function (Node $node): ?bool {
$connectionAssign = $this->betterNodeFinder->findFirstPrevious($funcCall, function (Node $node): bool {
if (! $node instanceof Assign) {
return null;
return false;
}

return $this->isObjectType($node->expr, new ObjectType('mysqli'));
});

if (! $connectionAssign instanceof Assign) {
return null;
return false;
}

return $connectionAssign->var;
Expand Down

0 comments on commit 682b1d1

Please sign in to comment.