20250204
This commit is contained in:
7
vendor/sebastian/complexity/ChangeLog.md
vendored
7
vendor/sebastian/complexity/ChangeLog.md
vendored
@@ -2,12 +2,6 @@
|
||||
|
||||
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
|
||||
@@ -78,7 +72,6 @@ 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...main
|
||||
[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
|
||||
|
2
vendor/sebastian/complexity/LICENSE
vendored
2
vendor/sebastian/complexity/LICENSE
vendored
@@ -1,6 +1,6 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2020-2025, Sebastian Bergmann
|
||||
Copyright (c) 2020-2024, Sebastian Bergmann
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
2
vendor/sebastian/complexity/README.md
vendored
2
vendor/sebastian/complexity/README.md
vendored
@@ -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)
|
||||
|
||||
|
9
vendor/sebastian/complexity/composer.json
vendored
9
vendor/sebastian/complexity/composer.json
vendored
@@ -15,18 +15,17 @@
|
||||
"issues": "https://github.com/sebastianbergmann/complexity/issues",
|
||||
"security": "https://github.com/sebastianbergmann/complexity/security/policy"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.3",
|
||||
"php": ">=8.2",
|
||||
"nikic/php-parser": "^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^12.0-dev"
|
||||
"phpunit/phpunit": "^11.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "8.3.0"
|
||||
"php": "8.2.0"
|
||||
},
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
@@ -38,7 +37,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "5.0-dev"
|
||||
"dev-main": "4.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -51,6 +51,7 @@ 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(array_values($items));
|
||||
return new self($items);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,6 +13,7 @@ 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;
|
||||
@@ -110,6 +111,7 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract
|
||||
}
|
||||
|
||||
assert(isset($parent->namespacedName));
|
||||
assert($parent->namespacedName instanceof Name);
|
||||
|
||||
return $parent->namespacedName->toString() . '::' . $node->name->toString();
|
||||
}
|
||||
@@ -120,7 +122,12 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract
|
||||
private function functionName(Function_ $node): string
|
||||
{
|
||||
assert(isset($node->namespacedName));
|
||||
assert($node->namespacedName instanceof Name);
|
||||
|
||||
return $node->namespacedName->toString();
|
||||
$functionName = $node->namespacedName->toString();
|
||||
|
||||
assert($functionName !== '');
|
||||
|
||||
return $functionName;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract
|
||||
*/
|
||||
private int $cyclomaticComplexity = 1;
|
||||
|
||||
public function enterNode(Node $node): null
|
||||
public function enterNode(Node $node): void
|
||||
{
|
||||
switch ($node::class) {
|
||||
case BooleanAnd::class:
|
||||
@@ -49,8 +49,6 @@ final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract
|
||||
case While_::class:
|
||||
$this->cyclomaticComplexity++;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user