74637[TASK] Remove dead code paths identified by PHPStan
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Nikita Hovratov +1
-
Verified V +2 Done
- Stefan Bürk +2
- Nikita Hovratov +1
- core-ci +1 CI
Issues 1
Files 11
- Build/phpstan/phpstan-baseline.neon+0 −50
- typo3/sysext/backend/Classes/Controller/File/ThumbnailController.php+1 −1
- typo3/sysext/core/Classes/Authentication/IpLocker.php6+1 −3
- typo3/sysext/core/Classes/Database/Connection.php+1 −3
- typo3/sysext/core/Classes/Page/PageRenderer.php+1 −1
- typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php+9 −13
- typo3/sysext/extbase/Classes/Mvc/Controller/Arguments.php+0 −4
- typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php3+0 −3
- typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php+1 −1
- typo3/sysext/frontend/Tests/Functional/SiteHandling/Framework/Builder/VariablesContext.php+1 −1
- typo3/sysext/install/Classes/Updates/ShortcutRecordsMigration.php+0 −4
Review log 1925
-
crell uploaded patch set 1 05/12/22, 21:37
-
core-ci voted on patch set 1 V +1 05/12/22, 21:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27154
-
crell uploaded patch set 2 05/12/22, 21:54
-
crell uploaded patch set 3 05/12/22, 21:56
-
core-ci voted on patch set 2 V +1 05/12/22, 22:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27156
-
core-ci voted on patch set 3 V +1 05/12/22, 22:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27157
-
Stefan Bürk updated the commit message in patch set 4 05/13/22, 00:23
-
Stefan Bürk commented on patch set 4 05/13/22, 00:29
LazyObjectStorage.php:181Not sure about this. In the whole chain which can happen, most is only doctyped. In the shipped core way, this will end up with a guaranteed int for $numberOfElements. But if there are Backend/StorageBackend overrides used (xclass/custom) this may be not the case as the corresponding interfaces are not (strict) return typed. How should we proceed with this ? -
core-ci voted on patch set 4 V +1 05/13/22, 00:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27161
-
crell commented on patch set 4 05/13/22, 13:54
IpLocker.php:84ReplyNone of these changes affect a signature, so why would they be backported?LazyObjectStorage.php:181ReplyMy inclination is to say "if you have a class that is not following the docblock types, it's already your bug, not core's, so you're on your own." The only way I can see that someone could get a non-countable object in there is to override either QueryInterface or DataMapper. Both seem like edge cases. Plus, if they were overriding either in a way that returns null, they'd be hitting an exception already. So I don't see a way that any existing *working* code could be broken here. The worst case is that, in the future, it would be possible to write buggy extension code that returns null and you wouldn't get a dedicated error message. But the extension code would still be just as buggy. Moving the types from docblocks to the signature should also be done, but I don't think that's necessarily a blocker here. -
Stefan Bürk commented on patch set 4 05/13/22, 14:07
IpLocker.php:84ReplyWhy should we not backport removal of dead code and clean phpstan baseline in 11 lts also ? At least if it is possible and doable. Howver this is the only part which must be kept, as explode() in 7.4 may return false instead of a exception. This comment is just a reminder that it get not forgotten on the backport. -
crell commented on patch set 4 05/13/22, 14:43
IpLocker.php:84Reply"Don't mess with LTS unless you have to" is the standard I'm used to. Georg mentioned in a previous issue that LTS has been broken by accident in the past, and these changes have no impact on cross-version compatibility the way type changes would, so I just don't see the point. If they do get backported then I concur the explode() change should not be included for reasons stated. I just doing see the point in backporting any of it. -
Stefan Bürk uploaded patch set 5 05/13/22, 17:56
-
core-ci voted on patch set 5 V +1 05/13/22, 18:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27187
-
Stefan Bürk commented on patch set 5 05/13/22, 18:05
IpLocker.php:84ReplyFor me for backport to 11.5: * bugfixes fixing issues (errors, missbehaviours, not working correct etc) * security bugfixes * removing dead-code * docblock improvements for phpstan / baseline reducing (if doable) which not (or must be at least changed during backport): * breaking type/return type additions (exception may be made for internal marked classes - depends) * features are a no-go for backport * if backport needs a lot of adjustments which renders the backport nearly to a fully new patch - decide to leave it out (except it's a security or tougher bug which is fixed ...) for 10.4 backport it's even smaller: * only security bugfixes * only really annoying bugfixes for real issues * no phpstan/docblock/typehint/return only patches just as a dumb-rule thing. In the end, the merger who merges the patch may decide if he really takes the responibility for the backport or not. -
crell commented on patch set 5 05/16/22, 19:37
IpLocker.php:84ReplyDone -
Stefan Bürk commented on patch set 5 V +1 CR +1 05/16/22, 23:27
LazyObjectStorage.php:181ReplyDone -
Oliver Klee voted on patch set 5 CR +1 05/17/22, 08:02
-
Oliver Klee wrote 05/18/22, 19:41
Removed reviewer Oliver Klee with the following votes: * Code-Review+1 by Oliver Klee -
Nikita Hovratov rebased onto patch set 6 05/27/22, 14:10
-
Nikita Hovratov voted on patch set 6 V +1 CR +1 05/27/22, 14:16
-
core-ci voted on patch set 6 V +1 05/27/22, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27493
-
Oliver Klee voted on patch set 6 CR +1 05/27/22, 14:43
-
Stefan Bürk voted on patch set 6 V +2 CR +2 05/28/22, 20:26
-
Stefan Bürk merged patch set 7 05/28/22, 20:26
IpLocker.php:84