Fix PHP 8.1 deprecation on mysqli::real_connect() calls#5296
Merged
derrabus merged 1 commit intodoctrine:2.13.xfrom Feb 25, 2022
iammati:2.13.x
Merged
Fix PHP 8.1 deprecation on mysqli::real_connect() calls#5296derrabus merged 1 commit intodoctrine:2.13.xfrom iammati:2.13.x
mysqli::real_connect() calls#5296derrabus merged 1 commit intodoctrine:2.13.xfrom
iammati:2.13.x
Conversation
Contributor
|
/**
* @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
Member
|
Thank you! |
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 <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
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 <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
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 <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
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 <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
This file contains hidden or 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
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_connectmethod inside theMysqliConnectiondriver is throwing an exception;mysqli::real_connect(): Passing null to parameter #7 ($flags) of type int is deprecated.To resolve this, a
0instead ofnullwill be used.I'm not really familiar with bits values at all, so if
0is a bad default value feel free to adjust that - was only able to track it down at that part here. :)Summary
Replaced the
?? nullwith?? 0when trying to retrieve the flags' driver-options since PHP 8.1 does no longer acceptnullfor the 7th parameter$flagsof thereal_connectmethod.