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 deprecation: PDOStatement::bindParam(): Passing null to $maxLength #586

Merged
merged 5 commits into from
Feb 14, 2022

Conversation

Jeroeny
Copy link
Contributor

@Jeroeny Jeroeny commented Dec 23, 2021

PHP version: 8.1.1
doctrine/dbal: 3.2.0
sentry/sentry-symfony: 4.2.5

Deprecated: PDOStatement::bindParam(): Passing null to parameter #4 ($maxLength) of type int is deprecated in ./vendor/doctrine/dbal/src/Driver/PDO/Statement.php on line 83

While it may seem that the deprecation is caused by that Doctrine Statement class, it is in fact caused by passing $length as null to that method which is then passed on the the PDOStatement method call. The fix is done the same way as in Doctrine: https://github.com/doctrine/dbal/blob/3.2.x/src/Driver/PDO/Statement.php#L83

Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, can you please add a test and a changelog entry?

@Jeroeny
Copy link
Contributor Author

Jeroeny commented Dec 27, 2021

@Jean85 I've added a test and changelog line. I couldn't just use a willReturnCallback, because phpunit always passed the variable explicitly as null.

@Jeroeny Jeroeny requested a review from Jean85 December 28, 2021 15:47
Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, but the CI is broken. Please fix the Code Style (make cs will do it for you) and fix the test, it's failing for this error:

PHP Fatal error:  Class Sentry\SentryBundle\Tests\Tracing\Doctrine\DBAL\TestStatement must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0```

@ste93cry
Copy link
Collaborator

@Jeroeny are you up to finish the PR? Otherwise I would be happy to make the changes needed to merge it on your behalf

@Jeroeny
Copy link
Contributor Author

Jeroeny commented Jan 18, 2022

@ste93cry Feel free to continue with these changes. I probably won't be able to spend time on it anytime soon.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Jeroeny and others added 4 commits February 13, 2022 00:19
…to parameter getsentry#4 ($maxLength) of type int is deprecated in ./vendor/doctrine/dbal/src/Driver/PDO/Statement.php on line 83
@Jean85 Jean85 merged commit 3a16fdc into getsentry:master Feb 14, 2022
@keichinger
Copy link

@Jean85 do you have a rough ETA when a new version will be released that contains this PR?

@Jean85
Copy link
Collaborator

Jean85 commented Feb 18, 2022

Release of 4.2.7 is in process: https://github.com/getsentry/sentry-symfony/actions/runs/1865381549

@fbnfgc
Copy link

fbnfgc commented Feb 21, 2022

@Jean85 thanks for your work on this issue.

It looks like the 4.2.7 version has not been released yet. Do you need to push the tag manually?

@Jean85
Copy link
Collaborator

Jean85 commented Feb 21, 2022

No, there's just a manual step in the process that requires a Sentry employee approval. It'll be here soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants