Closed (fixed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jan 2022 at 11:09 UTC
Updated:
15 Feb 2022 at 12:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
longwaveComment #3
mglamanReviewed the code and ran PHPStan locally. Fixes the errors and ensures that the variables initiated before including the files.
Not entirely relevant to the issue at hand, but it'd be better if we ran the include in a static closure with the minimum variables passed.
Here's an example from PHPStan itself:
In these cases we could leverage
useto pass items by reference.Comment #4
daffie commented+1 for RTBC.
Comment #5
alexpottCommitted f29ceb6 and pushed to 10.0.x. Thanks!
There is a subtle behaviour change here. If the file sets $overrides to something other then an array this would result in it being set. However setting it to something other than an array is an error so it's probably better to fail here.
#3 seems worth a follow-up as it'd further insulate from side-effects.