Skip to content
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

Fix PHPStan on level 1 #248

Closed
dmohns opened this issue Aug 9, 2024 · 0 comments · Fixed by #408
Closed

Fix PHPStan on level 1 #248

dmohns opened this issue Aug 9, 2024 · 0 comments · Fixed by #408
Assignees
Labels
Code base improvement Any improvements to the code base which makes it more maintainable or easier to use for users.

Comments

@dmohns
Copy link
Member

dmohns commented Aug 9, 2024

Scope:

Currently, running

php ../composer.phar run phpstan-analyse

returns a couple of errors.

Most of them are related to model changes

 ------ ----------------------------------------------------------------------------
  Line   Http/Controllers/Reports.php
 ------ ----------------------------------------------------------------------------
  552    Relation 'meter' is not found in App\Models\Transaction\Transaction model.
  552    Relation 'meter' is not found in App\Models\Transaction\Transaction model.
 ------ ----------------------------------------------------------------------------

or mis-use of Laravel objects

 ------ --------------------------------------------------------------------------------
  Line   Services/AgentBalanceHistoryService.php
 ------ --------------------------------------------------------------------------------
  58     Called 'last' on Laravel collection, but could have been retrieved as a query.
  72     Called 'avg' on Laravel collection, but could have been retrieved as a query.
  79     Called 'avg' on Laravel collection, but could have been retrieved as a query.
 ------ --------------------------------------------------------------------------------

and should be fixed.

Definition of done:

The Github Action step composer run phpstan-analyze is enabled (i.e. continue-on-error: true is removed) and the check passes.

@dmohns dmohns added the Code base improvement Any improvements to the code base which makes it more maintainable or easier to use for users. label Aug 9, 2024
alchalade added a commit that referenced this issue Sep 23, 2024
alchalade added a commit that referenced this issue Oct 1, 2024
@beesaferoot beesaferoot self-assigned this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code base improvement Any improvements to the code base which makes it more maintainable or easier to use for users.
Projects
None yet
3 participants