- Issue created by @spokje
- Merge request !3823Issue #3353918: Fix PHPStan L1 errors "Variable $foo might not be defined." caused by non-exhaustive switch statements โ (Closed) created by spokje
- Status changed to Needs review
almost 2 years ago 7:11am 13 April 2023 - Status changed to RTBC
almost 2 years ago 11:28pm 13 April 2023 - ๐บ๐ธUnited States smustgrave
Don't mind marking but is the plan to tackle the others slowly? Seems to be 126 other instances in the baseline file.
- ๐ณ๐ฑNetherlands spokje
Don't mind marking but is the plan to tackle the others slowly? Seems to be 126 other instances in the baseline file.
That's at least my plan. Can't see a patch/MR with 126+ changes which have mostly unrelated causes being reviewable.
So IMHO it's better to "nibble" at that massive number by grouping some by cause.Granted: There's no way to ensure we get them all per issue, since it's a manual process and some can be missed.
But they will stand out when the number drops to something reasonable, and we can them identify and fix them easily. - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
almost 2 years ago Waiting for branch to pass - last update
almost 2 years ago 29,283 pass - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
almost 2 years ago Not currently mergeable. - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
almost 2 years ago Not currently mergeable. - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
almost 2 years ago Not currently mergeable. - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
almost 2 years ago Not currently mergeable. - last update
almost 2 years ago Custom Commands Failed - ๐ณ๐ฑNetherlands spokje
Rebased after weirdly TestBot didn't kick this back down to NW after failing to merge since 21 Apr 2023 at 13:56 CEST.
.
- last update
almost 2 years ago 29,366 pass - last update
almost 2 years ago 29,366 pass - last update
almost 2 years ago 29,371 pass - last update
almost 2 years ago 29,378 pass - Status changed to Needs work
almost 2 years ago 9:11am 6 May 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
sorry to push this back, just a couple of points
- last update
almost 2 years ago 29,379 pass - last update
almost 2 years ago 29,379 pass - last update
almost 2 years ago 29,378 pass, 1 fail - Status changed to Needs review
almost 2 years ago 4:03pm 6 May 2023 - ๐ณ๐ฑNetherlands spokje
Thanks @mondrake, fixed one thread, left a comment in the other.
- last update
almost 2 years ago 29,379 pass - Status changed to RTBC
almost 2 years ago 7:54pm 6 May 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
thanks, two nits but do not stop RTBC
- last update
almost 2 years ago 29,379 pass - last update
almost 2 years ago 29,379 pass - ๐ณ๐ฑNetherlands spokje
Thanks @mondrake agiain, think/hope i picked yer nits.
- last update
almost 2 years ago 29,380 pass - last update
almost 2 years ago 29,383 pass - last update
almost 2 years ago 29,388 pass - last update
almost 2 years ago 29,387 pass, 2 fail - last update
almost 2 years ago 29,388 pass - last update
almost 2 years ago 29,388 pass - last update
almost 2 years ago 29,388 pass - last update
almost 2 years ago 29,388 pass - last update
almost 2 years ago 29,395 pass - last update
almost 2 years ago 29,376 pass, 2 fail - last update
almost 2 years ago 29,399 pass - last update
almost 2 years ago 29,400 pass - last update
almost 2 years ago 29,409 pass - last update
almost 2 years ago 29,409 pass - last update
almost 2 years ago 29,415 pass - last update
almost 2 years ago 29,420 pass - last update
almost 2 years ago 29,420 pass 32:27 28:52 Running- last update
almost 2 years ago 29,429 pass - Status changed to Needs work
almost 2 years ago 2:31am 16 June 2023 - ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Needs a rebase on 11.x
- last update
almost 2 years ago 29,473 pass - Status changed to RTBC
almost 2 years ago 4:40am 16 June 2023 - Status changed to Needs work
almost 2 years ago 10:02am 16 June 2023 - ๐ฌ๐งUnited Kingdom longwave UK
Overall I like this change as it removes a lot of verbosity, but in some cases perhaps we have gone a bit too far in making the code very dense and hard to understand.
- last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,475 pass - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago 29,477 pass - Status changed to Needs review
almost 2 years ago 1:23pm 16 June 2023 - Status changed to Needs work
almost 2 years ago 2:08pm 16 June 2023 - ๐ฌ๐งUnited Kingdom longwave UK
One more simplification, and I think a bug has been introduced.
- First commit to issue fork.
- last update
almost 2 years ago 29,486 pass - Status changed to Needs review
almost 2 years ago 6:22pm 16 June 2023 - Status changed to RTBC
almost 2 years ago 5:39pm 17 June 2023 - ๐บ๐ธUnited States smustgrave
Points from threads appear to have been addressed.
- Status changed to Needs review
almost 2 years ago 8:06am 18 June 2023 - ๐ณ๐ฑNetherlands spokje
Added some remarks (just to show I'm a grumpy old man ;)
Back to NR for those.
- Status changed to Needs work
almost 2 years ago 1:28pm 22 June 2023 - last update
almost 2 years ago Custom Commands Failed - last update
almost 2 years ago Custom Commands Failed - Status changed to Needs review
almost 2 years ago 3:03pm 26 June 2023 - last update
almost 2 years ago 29,554 pass - Status changed to RTBC
almost 2 years ago 4:20pm 26 June 2023 - ๐บ๐ธUnited States smustgrave
All threads appear to be resolved.
Thanks @Spokje!
- Status changed to Needs review
almost 2 years ago 2:23pm 27 June 2023 - ๐ฌ๐งUnited Kingdom longwave UK
match()
throwsUnhandledMatchError
if no cases are matched, and I was wondering if this could somehow be a behaviour change in the asset groupers. I don't think there is anything stopping someone declaring an unhandled type - the default isfile
, andexternal
is supposedly the only other value, but at the moment it looks like this will cause either a warning or perhaps just a misgrouping, and this behaviour will change now?I also am a bit confused about this in
AssetResolver::getJsAssets()
, I couldn't see if or how typesetting
is somehow handled elsewhere:$settings_as_inline_javascript = [ 'type' => 'setting', 'group' => JS_SETTING, 'weight' => 0, 'data' => $settings, ];
I don't have any such concerns about the other issues, it seems OK for those to trigger errors if they try to match unexpected values.
- ๐ฌ๐งUnited Kingdom longwave UK
JsCollectionRenderer throws a LogicException if it's not a file, external or setting type, but I still don't see how settings don't end up in the grouper. It feels like these should be refactored to be value objects instead of arrays with a type key...
- ๐ฌ๐งUnited Kingdom longwave UK
JsCollectionRenderer throws a LogicException if it's not a file, external or setting type, but I still don't see how settings don't end up in the grouper. It feels like these assets should be refactored to be value objects instead of arrays with a type key...
- Status changed to Needs work
over 1 year ago 4:17pm 17 July 2023 - last update
over 1 year ago 29,815 pass - last update
over 1 year ago 29,887 pass - ๐ณ๐ฑNetherlands spokje
@longwave:
It took me a while to wrap my head around your comments, but the whole behaviour in the asset groupers is weird/bad/unwanted/name-your-posion.
If
type
is notfile
norexternal
, it looks like, besides throwing a notice (Undefined variable $group_keys) when the asset is the first in theassets
-array, the asset at least gets grouped with the asset before it.So at the very least, we need a followup to sort that out.
I can't imagine there being much non-
file
/external
assets around in the wild, but the change in the current MR would indeed break those.Let's sort both
CssCollectionGrouper
andJsCollectionGrouper
in the follow-up issue. - last update
over 1 year ago 29,887 pass - ๐ณ๐ฑNetherlands spokje
We _could_ add a
default
to the currentswitch
statements inCssCollectionGrouper
andJsCollectionGrouper
where we throw a deprecation if thetype
is neitherfile
norexternal
to warn people early.But that could also be better to do in the follow-up?
- last update
over 1 year ago 30,161 pass - Status changed to Needs review
about 1 year ago 5:06pm 25 March 2024 - ๐ฌ๐งUnited Kingdom longwave UK
Rebased, let's revive this and try to get these cases fixed, the asset grouping ones can be fixed elsewhere.
- Status changed to RTBC
about 1 year ago 5:50pm 25 March 2024 -
alexpott โ
committed b2c9207d on 10.3.x
Issue #3353918 by Spokje, longwave, rpayanm, mondrake: Fix PHPStan L1...
-
alexpott โ
committed b2c9207d on 10.3.x
-
alexpott โ
committed 519dc8de on 11.x
Issue #3353918 by Spokje, longwave, rpayanm, mondrake: Fix PHPStan L1...
-
alexpott โ
committed 519dc8de on 11.x
- Status changed to Fixed
about 1 year ago 1:18pm 27 March 2024 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
Discussed with @longwave, we agreed that UnhandledMatchError is better than the current behaviour of warning a variable is not set and then breaking in odd ways.
Merged back to 10.3.x - nice work everyone.
Automatically closed - issue fixed for 2 weeks with no activity.