Closed (fixed)
Project:
Drupal core
Version:
11.1.x-dev
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Jun 2023 at 19:44 UTC
Updated:
23 Mar 2026 at 13:37 UTC
Jump to comment: Most recent
Comments
Comment #3
mondrakeComment #4
mondrakeComment #6
mondrakeFrom https://www.php.net/manual/en/function.include.php
So in this case,
$databasesis a local variable ofInstallerNonDefaultDatabaseDriverTest::getInstalledDatabaseSettings()coming from the evaluation of the code in the included settings.php file.Comment #7
daffie commentedNow I get it. Thanks for the explanation. Could you remove the
assert(isset($databases));from the PR and add a comment with your explanation? After that it is RTBC for me.Comment #8
mondrakeI had to add the assert since PHPStan was complaining more or less for the same reason of your comment - PHPStan cannot determine what's included in the include (pun intended), so we need to inform it that a variable with that name is existing at that point.
Once the parent is committed I will rebase and add a comment.
Comment #9
mondrakeDone.
Comment #10
daffie commentedAll code change look good to me.
The test has been improved.
For me it is RTBC.
Comment #11
alexpottBackported to 11.1.x as test-only change.
Committed and pushed c8a7a5894c9 to 11.x and 5f901886979 to 11.2.x and bc806750d89 to 11.1.x. Thanks!
Comment #15
alexpott