Skip to content

Commit

Permalink
current class lines count
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jul 26, 2023
1 parent a27bcd8 commit eba4517
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function incrementLogicalLines(): void

public function currentClassReset(): void
{
if ($this->currentClassLines > 0) {
$this->addToArray('class lines', $this->currentClassLines);
}

$this->currentClassLines = 0;
$this->currentNumberOfMethods = 0;
}
Expand Down
9 changes: 9 additions & 0 deletions src/Enum/MetricName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace TomasVotruba\Lines\Enum;

final class MetricName
{
}
6 changes: 3 additions & 3 deletions tests/unit/AnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function test(): void
$this->assertEqualsWithDelta(
[
'files' => 1,
'loc' => 75,
'lloc' => 24,
'loc' => 80,
'lloc' => 30,
'llocClasses' => 22,
'llocFunctions' => 1,
'llocGlobal' => 1,
Expand Down Expand Up @@ -56,7 +56,7 @@ public function test(): void
'instanceMethodCalls' => 2,
'directories' => 0,
'namespaces' => 1,
'ncloc' => 68,
'ncloc' => 73,
'classLlocMin' => 0,
'classLlocAvg' => 7.3,
'classLlocMax' => 22,
Expand Down

0 comments on commit eba4517

Please sign in to comment.