Skip to content

Commit 256bb54

Browse files
Merge pull request #1 from hmorv/main
Avoid return negative weight
2 parents b6003ec + 6fc620b commit 256bb54

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Method.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function countArguments(): int
4141

4242
public function getWeight(): int
4343
{
44-
return $this->getLine() * $this->countArguments();
44+
$weight = $this->getLine() * $this->countArguments();
45+
46+
return $weight > 0 ? $weight : 0;
4547
}
4648

4749
public function isConstructor(): bool

0 commit comments

Comments
 (0)