Skip to content

Avoid return negative weight #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2022
Merged

Conversation

hmorv
Copy link

@hmorv hmorv commented Aug 31, 2022

When showing results, if there's an interface in the scanned folder that has methods with arguments, it returns a negative weight (-2 * args), because of getLine() method it substracts always 2 (I guess its for the curly braces of the method).

avoid to return negative weight
@DeGraciaMathieu
Copy link
Owner

Hello Hmorv 👋

Please, can you just simplify a little the logic ?

$weight = $this->getLine() * $this->countArguments();

return $weight > 0 ? $weight : 0;

Thx for this fix !

simplify logic
@DeGraciaMathieu DeGraciaMathieu merged commit 256bb54 into DeGraciaMathieu:main Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants