81632[BUGFIX] Update `phpstan/phpstan` to 1.10.40
Commit message
Review
-
Code review CR +2 Done
- Andreas Kienast +2
- Benjamin Franzke +1
- Oliver Hader +1
-
Verified V +2 Done
- Andreas Kienast +2
- Benjamin Franzke +1
- Oliver Hader +1
- core-ci +1 CI
Issues 1
Files 3
Review log 1620
-
Andreas Kienast uploaded patch set 1 10/31/23, 07:08
-
core-ci voted on patch set 1 V +1 10/31/23, 07:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48380
-
Andreas Kienast updated the commit message in patch set 2
V +110/31/23, 07:23 -
Benjamin Franzke voted on patch set 2 V +1 CR +1 10/31/23, 07:29
-
core-ci voted on patch set 2 V +1 10/31/23, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48381
-
Oliver Hader commented on patch set 2 CR -1 10/31/23, 07:34
I'd like to check something here... -
Oliver Hader commented on patch set 2 10/31/23, 07:42
What would happen, if you'd introduce a new `NavigationDirection::OTHER` and use that for the mentioned protected method? -
Andreas Kienast commented on patch set 2 CR -1 10/31/23, 07:48
Reply
I would've expected that phpstan goes poof, which is apparently not the case. Great success. Not. -
Andreas Kienast uploaded patch set 3
CR +1V +110/31/23, 07:54 -
Oliver Hader commented on patch set 3 10/31/23, 07:57
Reply
I just want to repeat myself in general: "Don't blindly trust any static code analysis tool" 😊 A potential solution here (and for other cases) would be introduce a `default` case. Anyway, I think this one is a bug in PhpStan since it is giving advise without having evidence - and this is "great" for introducing new bugs without actually realizing it... -
Andreas Kienast commented on patch set 3 CR -2 10/31/23, 08:01
Reply
I think this isn't really a bug. IconFactory->getIcon() doesn't declare the type of it's `$identifier` parameter, technically allowing `null`. In that case, the IconFactory will fall back to the default "broken" icon. Let's have a talk about this how to continue. -
core-ci voted on patch set 3 V +1 10/31/23, 08:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48384
-
Benjamin Franzke uploaded patch set 4
V +110/31/23, 08:24Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR is:MIN") -
Benjamin Franzke commented on patch set 4 V +1 CR +1 10/31/23, 08:24
Reply
Thanks for bringing that up, I was really sure phpstan would perform an exhaustiveness check for all enum-cases when used in `switch`, but it turns out it does only do that for `match`, see https://github.com/phpstan/phpstan/issues/7521#issuecomment-1164581820 Let's switch to `match`, then a new enum value will result in: ``` 553 Match expression does not handle remaining value: TYPO3\CMS\Filelist\Type\NavigationDirection::FOO ``` -
Andreas Kienast voted on patch set 4 CR 0 10/31/23, 08:29
-
core-ci voted on patch set 4 V +1 10/31/23, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48386
-
Andreas Kienast commented on patch set 4 CR -1 10/31/23, 08:32
Let's wait for Olly's vote. -
Oliver Hader commented on patch set 4 V +1 CR +1 10/31/23, 08:57
FileList.php:555Unresolvedin case `default => null` would be added here, PhpStan would still not find it → which is a bug in PhpStan (and not a problem for us right now) -
Andreas Kienast voted on patch set 4 V +2 CR +2 10/31/23, 09:02
-
Andreas Kienast merged patch set 5 10/31/23, 09:02