-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PHP 8.1 compatibility for 2.13 #4735
Conversation
Note, DBAL 2.x is only supported in the part of improving the upgrade path to 3.x. I do not think we should be beating the dead horse and adding the support for PHP 8.1 thus increasing the supported version range from PHP 7.1 to 8.1. |
See my comment #4734 (comment) Let's continue the discussion there. |
868efb3
to
7cf7317
Compare
7cf7317
to
7c9f37c
Compare
Co-authored-by: Sergei Morozov <morozov@tut.by> Signed-off-by: Alexander M. Turek <me@derrabus.de>
7c9f37c
to
ae37075
Compare
@@ -24,7 +24,7 @@ | |||
abstract class AbstractAsset | |||
{ | |||
/** @var string */ | |||
protected $_name; | |||
protected $_name = ''; |
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.
Since it comes from a newer major release, I'd double check if it can cause any BC break. Do such changes belong to a patch release at all or the support for a new backwards-incompatible PHP version deserves a minor release?
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.
All code that I could find that accesses this property already assumes that it is a string. In most cases, the value is used in a string concatenation operation which would implicitly cast it to an empty string if it were null
.
@@ -104,7 +104,7 @@ public function testListForeignKeysFromExistingDatabase(): void | |||
new Schema\ForeignKeyConstraint( | |||
['log'], | |||
'log', | |||
[''], | |||
[], |
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.
Since it comes from a newer major release, I'd double check if it can cause any BC break.
Thanks, @derrabus! |
Summary
The methods
getDateTimeTzFormatString()
andgetDateTimeFormatString()
will never returnnull
in real implementations, but this is what the mock created in that test currently does.Their return value is passed to
DateTime::format()
. Passingnull
to that method triggers a deprecation warning in PHP 8.1. With this PR, I'd like to fix the broken mock.