-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Test against PHP 8.4 #378
base: 5.x
Are you sure you want to change the base?
Test against PHP 8.4 #378
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,12 @@ | |
phpVersion="8.1" | ||
resolveFromConfigFile="true" | ||
rememberPropertyAssignmentsAfterCall="false" | ||
ensureOverrideAttribute="false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please set this to true, override attributes are recommended adn compatible with all PHP versions if the symfony/polyfill-php83 packages required |
||
findUnusedCode="false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep this on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a library, everything is unused code! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, public code must be marked with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep this config off unless psalm offers a way to "default-mark" everything non-internal & non-private as API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with default-marking everything non-internal and non-private as API is with non-library codebases (that have no public surface apart from API controllers and other entry points). Some not so clean library codebases have the same problem as well, where internal details are needlessly exposed as public and not marked as internal. Explicitly marking public API with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danog I think it would be a good thing to make that configurable in psalm. |
||
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" | ||
xmlns:xi="http://www.w3.org/2001/XInclude" | ||
> | ||
<projectFiles> | ||
<directory name="examples"/> | ||
|
@@ -24,6 +27,20 @@ | |
</errorLevel> | ||
</StringIncrement> | ||
|
||
<ImplicitToStringCast> | ||
<errorLevel type="suppress"> | ||
<directory name="examples"/> | ||
<directory name="src"/> | ||
</errorLevel> | ||
</ImplicitToStringCast> | ||
|
||
<InvalidOperand> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't suppress this at a project level There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vimeo/psalm#11329 will fix what you're (incorrectly) trying to fix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not only that. The code often do some There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have issues with that, just set strictBinaryOperands="false", do not suppress the issue as it also covers valid errors There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need lower versions of psalm for php versions compatibility. It would not work anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Psalm is capable of running scans for versions down to php 5.4 on php 8.4, just pass the correct PHP version using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Psalm scans should always run on PHP 8.4.4 or above to avoid platform bugs, to target lower versions of PHP simply use the |
||
<errorLevel type="suppress"> | ||
<directory name="examples"/> | ||
<directory name="src"/> | ||
</errorLevel> | ||
</InvalidOperand> | ||
|
||
<DuplicateClass> | ||
<errorLevel type="suppress"> | ||
<directory name="examples"/> | ||
|
@@ -42,12 +59,6 @@ | |
</errorLevel> | ||
</DocblockTypeContradiction> | ||
|
||
<MissingClosureParamType> | ||
<errorLevel type="suppress"> | ||
<directory name="src"/> | ||
</errorLevel> | ||
</MissingClosureParamType> | ||
|
||
<MissingClosureReturnType> | ||
<errorLevel type="suppress"> | ||
<directory name="src" /> | ||
|
@@ -59,5 +70,11 @@ | |
<directory name="src" /> | ||
</errorLevel> | ||
</RiskyTruthyFalsyComparison> | ||
|
||
<InvalidReturnType> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't suppress this at the file level |
||
<errorLevel type="suppress"> | ||
<file name="src/Connection/Internal/Http1Parser.php" /> | ||
</errorLevel> | ||
</InvalidReturnType> | ||
</issueHandlers> | ||
</psalm> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version will be 6 but different regarding the PHP version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should at least require the latest
^6.8.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you read the message I wrote just above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and your assumption is wrong: you should always require the latest available version of Psalm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The composer.json of psalm/phar does not allow this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, just require psalm 6.8.5