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.
|
||||
|
||||
## [4.0.0] - 2025-02-07
|
||||
|
||||
### Removed
|
||||
|
||||
* This component is no longer supported on PHP 8.2
|
||||
|
||||
## [3.0.1] - 2024-07-03
|
||||
|
||||
### Changed
|
||||
@@ -59,6 +65,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
|
||||
|
||||
* Initial release
|
||||
|
||||
[4.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/3.0...4.0.0
|
||||
[3.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/3.0.0...3.0.1
|
||||
[3.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0...3.0.0
|
||||
[2.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0.1...2.0.2
|
||||
|
||||
+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/lines-of-code)
|
||||
[](https://packagist.org/packages/sebastian/lines-of-code)
|
||||
[](https://github.com/sebastianbergmann/lines-of-code/actions)
|
||||
[](https://codecov.io/gh/sebastianbergmann/lines-of-code)
|
||||
|
||||
|
||||
+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"
|
||||
"php": "8.3"
|
||||
},
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.0-dev"
|
||||
"dev-main": "4.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ final class Counter
|
||||
assert($nodes !== null);
|
||||
|
||||
return $this->countInAbstractSyntaxTree($linesOfCode, $nodes);
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Error $error) {
|
||||
throw new RuntimeException(
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of sebastian/lines-of-code.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace SebastianBergmann\LinesOfCode;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
final class NegativeValueException extends InvalidArgumentException implements Exception
|
||||
{
|
||||
}
|
||||
@@ -43,15 +43,17 @@ final class LineCountingVisitor extends NodeVisitorAbstract
|
||||
$this->linesOfCode = $linesOfCode;
|
||||
}
|
||||
|
||||
public function enterNode(Node $node): void
|
||||
public function enterNode(Node $node): null
|
||||
{
|
||||
$this->comments = array_merge($this->comments, $node->getComments());
|
||||
|
||||
if (!$node instanceof Expr) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->linesWithStatements[] = $node->getStartLine();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function result(): LinesOfCode
|
||||
|
||||
@@ -41,30 +41,9 @@ final readonly class LinesOfCode
|
||||
* @param non-negative-int $logicalLinesOfCode
|
||||
*
|
||||
* @throws IllogicalValuesException
|
||||
* @throws NegativeValueException
|
||||
*/
|
||||
public function __construct(int $linesOfCode, int $commentLinesOfCode, int $nonCommentLinesOfCode, int $logicalLinesOfCode)
|
||||
{
|
||||
/** @phpstan-ignore smaller.alwaysFalse */
|
||||
if ($linesOfCode < 0) {
|
||||
throw new NegativeValueException('$linesOfCode must not be negative');
|
||||
}
|
||||
|
||||
/** @phpstan-ignore smaller.alwaysFalse */
|
||||
if ($commentLinesOfCode < 0) {
|
||||
throw new NegativeValueException('$commentLinesOfCode must not be negative');
|
||||
}
|
||||
|
||||
/** @phpstan-ignore smaller.alwaysFalse */
|
||||
if ($nonCommentLinesOfCode < 0) {
|
||||
throw new NegativeValueException('$nonCommentLinesOfCode must not be negative');
|
||||
}
|
||||
|
||||
/** @phpstan-ignore smaller.alwaysFalse */
|
||||
if ($logicalLinesOfCode < 0) {
|
||||
throw new NegativeValueException('$logicalLinesOfCode must not be negative');
|
||||
}
|
||||
|
||||
if ($linesOfCode - $commentLinesOfCode !== $nonCommentLinesOfCode) {
|
||||
throw new IllogicalValuesException('$linesOfCode !== $commentLinesOfCode + $nonCommentLinesOfCode');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user