-
Notifications
You must be signed in to change notification settings - Fork 200
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
Psalm & PHPStan strict rules #217
Conversation
No errors on level 1 (the highest level for Psalm) and "Psalm was able to infer types for 100% of the codebase", not bad!
Psalm doesn't support PHP 8.4 yet (vimeo/psalm#11107) I'll take care of this PR once it does. |
I have this error on PHP 8.2 on an M1: vimeo/psalm#11067 |
Amazing! ❤️ |
Merging as the fatal error I got is not really fatal and it's passing on Github actions |
Hey @spaze, didn't you run Psalm on tests on purpose? I just added them to Psalm but also had to ignore some stuff: <?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<file name="tests/Google2FATest.php" />
</errorLevel>
<errorLevel type="suppress">
<file name="tests/QRCodeTest.php" />
</errorLevel>
</PropertyNotSetInConstructor>
<MixedAssignment>
<errorLevel type="suppress">
<file name="tests/helpers.php" />
</errorLevel>
</MixedAssignment>
<ForbiddenCode>
<errorLevel type="suppress">
<file name="tests/helpers.php" />
</errorLevel>
</ForbiddenCode>
</issueHandlers>
</psalm> And then opened a ticket on Psalm too: vimeo/psalm#11132 |
Unfortunately I haven't run Psalm on tests, for no particular reason other than I just forgot to use the same dirs that PHPStan runs on 😇 |
Great! I was just afraid you bumped into any other problems, so all good, thanks! |
Added Psalm and PHPStan strict rules.
Psalm: No errors on level 1 (the highest level for Psalm) and "Psalm was able to infer types for 100% of the codebase", not bad!