fix:repo cleanup

This commit is contained in:
2025-11-08 20:09:07 +00:00
parent f1da93791d
commit dedcc73567
1204 changed files with 121800 additions and 16971 deletions
-1
View File
@@ -51,7 +51,6 @@ final class Calculator
assert($nodes !== null);
return $this->calculateForAbstractSyntaxTree($nodes);
// @codeCoverageIgnoreStart
} catch (Error $error) {
throw new RuntimeException(
@@ -32,7 +32,7 @@ final readonly class ComplexityCollection implements Countable, IteratorAggregat
public static function fromList(Complexity ...$items): self
{
return new self($items);
return new self(array_values($items));
}
/**
@@ -13,7 +13,6 @@ use function assert;
use function is_array;
use PhpParser\Node;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
@@ -111,7 +110,6 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract
}
assert(isset($parent->namespacedName));
assert($parent->namespacedName instanceof Name);
return $parent->namespacedName->toString() . '::' . $node->name->toString();
}
@@ -122,12 +120,7 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract
private function functionName(Function_ $node): string
{
assert(isset($node->namespacedName));
assert($node->namespacedName instanceof Name);
$functionName = $node->namespacedName->toString();
assert($functionName !== '');
return $functionName;
return $node->namespacedName->toString();
}
}
@@ -31,7 +31,7 @@ final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract
*/
private int $cyclomaticComplexity = 1;
public function enterNode(Node $node): void
public function enterNode(Node $node): null
{
switch ($node::class) {
case BooleanAnd::class:
@@ -49,6 +49,8 @@ final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract
case While_::class:
$this->cyclomaticComplexity++;
}
return null;
}
/**