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: checks haystack is null before using stripos() #147

Closed
wants to merge 1 commit into from

Conversation

niamzor
Copy link
Contributor

@niamzor niamzor commented Jan 19, 2022

I got a deprecated error when using bugsnag-symfony with PHP 8.1 :

stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in vendor/bugsnag/bugsnag-symfony/Request/SymfonyRequest.php line 104

This is my first PR, so please tell me if something is not right.

Goal

Make bugsnag-symfony compatible with PHP 8.1.

Changeset

It checks that $haystack is not null before using stripos()

Testing

I ran phpunit tests

@luke-belton
Copy link
Contributor

Hi @phillylovepark - thanks for the PR! We're looking to add a static analysis tool like psalm/phpstan to bugsnag-symfony at some point in the future. This should help fix deprecated error messages such as this. We'll review this PR as part of that work when priorities allow 👍

@tarasTrujay
Copy link

Hey @luke-belton!
I really need this PR

@luke-belton
Copy link
Contributor

hey @tarasTrujay - as this is a deprecation warning, it's not considered a critical fix for us at this time while we have other higher priority work on our backlog. I don't have an exact timescale for the static analysis changes I described in my comment above, however I will notify this thread with any updates. The deprecated change being warned about won't break until php 9.0 is released, which is still a long way off.

@tarasTrujay
Copy link

@luke-belton But you can merge this PR and that's it

@imjoehaines imjoehaines changed the base branch from master to next January 31, 2022 17:30
@imjoehaines
Copy link
Contributor

Thanks for the PR @phillylovepark! I'm going to merge this down in #149 where I've added some unit tests for this class

@imjoehaines imjoehaines mentioned this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants