-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 PHP 8.1 deprecation on mysqli::real_connect()
calls
#5296
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**
* @tentative-return-type
* @alias mysqli_real_connect
*/
public function real_connect(
?string $hostname = null,
?string $username = null,
?string $password = null,
?string $database = null,
?int $port = null,
?string $socket = null,
int $flags = 0
): bool {} |
derrabus
approved these changes
Feb 25, 2022
Thank you! |
derrabus
changed the title
Fix #4869: PHP 8.1 deprecated passing null to #7 flags parameter for …
Fix PHP 8.1 deprecation on Feb 25, 2022
mysqli::real_connect()
calls
tzkoshi
pushed a commit
to tzkoshi/dbal
that referenced
this pull request
Mar 16, 2022
Release [2.13.8](https://github.com/doctrine/dbal/milestone/104) 2.13.8 ====== - Total issues resolved: **1** - Total pull requests resolved: **9** - Total contributors: **3** CI,SQL Server ------------- - [5303: Run workflow on AppVeyor only if certain files changed](doctrine#5303) thanks to @morozov Dependencies,Static Analysis ---------------------------- - [5300: Psalm 4.22.0, PHPUnit 9.5.16](doctrine#5300) thanks to @derrabus Bug,PHP,mysqli -------------- - [5296: Fix PHP 8.1 deprecation on `mysqli::real&doctrine#95;connect()` calls](doctrine#5296) thanks to @iammati Error Handling,Static Analysis,mysqli ------------------------------------- - [5269: Run static analysis jobs on PHP 8.1](doctrine#5269) thanks to @morozov Static Analysis --------------- - [5262: PHPStan 1.4.6, Psalm 4.20.0, PHPUnit 9.5.13](doctrine#5262) thanks to @derrabus - [5178: PHPStan 1.4.0](doctrine#5178) thanks to @derrabus CI -- - [5238: Run PHP 7.4 on AppVeyor](doctrine#5238) thanks to @derrabus Documentation ------------- - [5187: Update README for release 3.3](doctrine#5187) thanks to @derrabus Connections,Reserved Keywords,Static Analysis --------------------------------------------- - [5166: Enforce consistent constructor in dynamically instantiated classes](doctrine#5166) thanks to @morozov
reviewtypo3org
pushed a commit
to TYPO3/typo3
that referenced
this pull request
Mar 22, 2022
This patch raises doctrine/dbal to 2.13.8 as minimum version, which contains a bugfix to avoid a native php error is emitted, stating "mysqli::real_connect(): Passing null to parameter #7". See: doctrine/dbal#5296 One phpstan ignore pattern slightly changed because of a changed return type declarion of doctrine/dbal. Tackling the corresponding error should be done in a dedicated test after proper investigation. Used commands: > composer req doctrine/dbal:^2.13.8 > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/install --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/redirects --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > Build/Scripts/runTests.sh -s phpstanGenerateBaseline Resolves: #97222 Releases: 11.5 Change-Id: I6c1712a792780bd2966b3977d43f767e59304bd5 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74013 Tested-by: core-ci <[email protected]> Tested-by: Benni Mack <[email protected]> Reviewed-by: Benni Mack <[email protected]>
TYPO3IncTeam
pushed a commit
to TYPO3-CMS/core
that referenced
this pull request
Mar 22, 2022
This patch raises doctrine/dbal to 2.13.8 as minimum version, which contains a bugfix to avoid a native php error is emitted, stating "mysqli::real_connect(): Passing null to parameter #7". See: doctrine/dbal#5296 One phpstan ignore pattern slightly changed because of a changed return type declarion of doctrine/dbal. Tackling the corresponding error should be done in a dedicated test after proper investigation. Used commands: > composer req doctrine/dbal:^2.13.8 > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/install --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/redirects --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > Build/Scripts/runTests.sh -s phpstanGenerateBaseline Resolves: #97222 Releases: 11.5 Change-Id: I6c1712a792780bd2966b3977d43f767e59304bd5 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74013 Tested-by: core-ci <[email protected]> Tested-by: Benni Mack <[email protected]> Reviewed-by: Benni Mack <[email protected]>
TYPO3IncTeam
pushed a commit
to TYPO3-CMS/install
that referenced
this pull request
Mar 22, 2022
This patch raises doctrine/dbal to 2.13.8 as minimum version, which contains a bugfix to avoid a native php error is emitted, stating "mysqli::real_connect(): Passing null to parameter #7". See: doctrine/dbal#5296 One phpstan ignore pattern slightly changed because of a changed return type declarion of doctrine/dbal. Tackling the corresponding error should be done in a dedicated test after proper investigation. Used commands: > composer req doctrine/dbal:^2.13.8 > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/install --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/redirects --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > Build/Scripts/runTests.sh -s phpstanGenerateBaseline Resolves: #97222 Releases: 11.5 Change-Id: I6c1712a792780bd2966b3977d43f767e59304bd5 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74013 Tested-by: core-ci <[email protected]> Tested-by: Benni Mack <[email protected]> Reviewed-by: Benni Mack <[email protected]>
TYPO3IncTeam
pushed a commit
to TYPO3-CMS/redirects
that referenced
this pull request
Mar 22, 2022
This patch raises doctrine/dbal to 2.13.8 as minimum version, which contains a bugfix to avoid a native php error is emitted, stating "mysqli::real_connect(): Passing null to parameter #7". See: doctrine/dbal#5296 One phpstan ignore pattern slightly changed because of a changed return type declarion of doctrine/dbal. Tackling the corresponding error should be done in a dedicated test after proper investigation. Used commands: > composer req doctrine/dbal:^2.13.8 > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/install --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/redirects --no-update > composer req doctrine/dbal:^2.13.8 \ -d typo3/sysext/core --no-update > Build/Scripts/runTests.sh -s phpstanGenerateBaseline Resolves: #97222 Releases: 11.5 Change-Id: I6c1712a792780bd2966b3977d43f767e59304bd5 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74013 Tested-by: core-ci <[email protected]> Tested-by: Benni Mack <[email protected]> Reviewed-by: Benni Mack <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current issue with the 2.13.x branch is that, as soon as deprecation exceptions are enabled, the
real_connect
method inside theMysqliConnection
driver is throwing an exception;mysqli::real_connect(): Passing null to parameter #7 ($flags) of type int is deprecated
.To resolve this, a
0
instead ofnull
will be used.I'm not really familiar with bits values at all, so if
0
is a bad default value feel free to adjust that - was only able to track it down at that part here. :)Summary
Replaced the
?? null
with?? 0
when trying to retrieve the flags' driver-options since PHP 8.1 does no longer acceptnull
for the 7th parameter$flags
of thereal_connect
method.