-
-
Notifications
You must be signed in to change notification settings - Fork 462
Add compatibility with monolog v3 #1321
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
Conversation
b66cc7f
to
aca1945
Compare
I'm a bit unsure on how to fix the phpstan and psalm pipeline. psalm seems to analyse the code based on PHP 7.2 and I don't know how to change that. The phpstan errors are related to the BC layer which makes sure that the handler can be used in monolog v2 and v3. Should I add the reported "errors" to the baseline file? |
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.
Thank you for the contribution. Since this is not a bug fix, please target the develop
branch.
psalm seems to analyse the code based on PHP 7.2 and I don't know how to change that.
Technically speaking, it's correct that Psalm complains because the code should run on any PHP version down to 7.2
. I think that the only viable solution is to update the baseline and ignore the errors. A more appropriate way could be to run the analysis more than once, one for PHP 7.2
and one for PHP 8.0
though, but it would be a bigger change and I wouldn't tackle it here
The phpstan errors are related to the BC layer which makes sure that the handler can be used in monolog v2 and v3. Should I add the reported "errors" to the baseline file?
The error is because PHPStan does not understand that the Logger::API
constant can change depending on which version of the package is installed. It should be enough to instruct it that the constant is dynamic by using the dynamicConstantNames
option.
@ste93cry Thank you for the hints! I have changed the target branch to |
977d64f
to
850b0e4
Compare
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.
Good work! Please add a changelog entry.
@Jean85 Done |
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.
I've left a few more comments, but they are just nitpick. You should also rebase the PR to solve the issues with PHPStan errors. The only concern I have, but to which I don't think there is solution that can be easily taken here, is that it looks weird to see errors related to the vendor
folder in the Psalm baseline 😞
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.
Thank you for the hard work!
Fixes #1318