fix:repo cleanup
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
|
||||
|
||||
## [5.0.0] - 2025-02-07
|
||||
|
||||
### Removed
|
||||
|
||||
* This component is no longer supported on PHP 8.2
|
||||
|
||||
## [4.0.1] - 2024-07-03
|
||||
|
||||
### Changed
|
||||
@@ -72,6 +78,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
|
||||
|
||||
* Initial release
|
||||
|
||||
[5.0.0]: https://github.com/sebastianbergmann/complexity/compare/4.0...5.0.0
|
||||
[4.0.1]: https://github.com/sebastianbergmann/complexity/compare/4.0.0...4.0.1
|
||||
[4.0.0]: https://github.com/sebastianbergmann/complexity/compare/3.2...4.0.0
|
||||
[3.2.0]: https://github.com/sebastianbergmann/complexity/compare/3.1.0...3.2.0
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2020-2024, Sebastian Bergmann
|
||||
Copyright (c) 2020-2025, Sebastian Bergmann
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
[](https://packagist.org/packages/sebastian/complexity)
|
||||
[](https://packagist.org/packages/sebastian/complexity)
|
||||
[](https://github.com/sebastianbergmann/complexity/actions)
|
||||
[](https://codecov.io/gh/sebastianbergmann/complexity)
|
||||
|
||||
|
||||
+4
-4
@@ -17,15 +17,15 @@
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"php": ">=8.3",
|
||||
"nikic/php-parser": "^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^11.0"
|
||||
"phpunit/phpunit": "^12.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "8.2.0"
|
||||
"php": "8.3.0"
|
||||
},
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "4.0-dev"
|
||||
"dev-main": "5.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-8
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user