Skip to content

Fix larastan on level 2 #411

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

Open
dmohns opened this issue Dec 11, 2024 · 4 comments · Fixed by #547
Open

Fix larastan on level 2 #411

dmohns opened this issue Dec 11, 2024 · 4 comments · Fixed by #547
Assignees
Labels
Code base improvement Any improvements to the code base which makes it more maintainable or easier to use for users. enhancement New feature or request help wanted Extra attention is needed

Comments

@dmohns
Copy link
Member

dmohns commented Dec 11, 2024

Scope:

Currently larastan on level 2 reports errors which indicate broken code in our code base.

For each of the reported errors please decide, whether the corresponding code

  • should be removed as it's never used
  • should be fixed as the application will break if executed

Definition of done:

The larastan level in phpstan.neon is set to 2 and the Github Action step composer run larastan passes.

@dmohns dmohns added enhancement New feature or request help wanted Extra attention is needed Code base improvement Any improvements to the code base which makes it more maintainable or easier to use for users. labels Dec 11, 2024
@alaincodes24
Copy link
Contributor

alaincodes24 commented Mar 8, 2025

@dmohns I checked phpstan.neon file and the level is set to 1. composer run larastan did not throw any errors but updating the level to 2 shows some errors. I'm working to address those errors, I wanted to let you that it was set to 1 instead of 2.

@dmohns
Copy link
Member Author

dmohns commented Mar 10, 2025

@dmohns I checked phpstan.neon file and the level is set to 1. composer run larastan did not throw any errors but updating the level to 2 shows some errors. I'm working to address those errors, I wanted to let you that it was set to 1 instead of 2.

Yes, this is correct 👍 To provide some context: Ultimately, our goal is to have Larastan set to level 10. However, because going from 0 to 10 requires massive refactoring, we decided to steadily move through Larastan levels, one at a time. We had previously managed to enable it on level 1, see here: #248

We also, added an "optional" CI step that checks Larastan on the next level, i.e. 2 currently, see https://github.com/EnAccess/micropowermanager/pull/410/files

What I would be expecting here, would be one (or multiple) Pull Requests that fix the issues reported by Larastan level 2. Once all are done, the optional Larastan (next) step on the CI should pass without errors. Once this has been achieved, we can dump the Larastan level in phpstan.neon.

@dmohns
Copy link
Member Author

dmohns commented Mar 17, 2025

Reopening, as it was closed by mistake. He are still not fully on level 2 yet 😉

@dmohns dmohns reopened this Mar 17, 2025
@alaincodes24
Copy link
Contributor

@dmohns good catch!

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. enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants