87348[TASK] phpstan staticMethod.alreadyNarrowedType
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Garvin Hicking +1
- Stefan Bürk +1
-
Verified V +2 Done
- Christian Kuhn +2
- Garvin Hicking +1
- Stefan Bürk +1
- core-ci +1 CI
Issues 2
Files 25
- Build/phpstan/phpstan-baseline.neon+0 −144
- typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/ExtensionTest.php4+4 −3
- typo3/sysext/extensionmanager/Tests/Unit/Report/ExtensionStatusTest.php+0 −18
- typo3/sysext/form/Classes/Mvc/Property/TypeConverter/FormDefinitionArrayConverter.php+7 −11
- typo3/sysext/form/Tests/Functional/Mvc/Property/TypeConverter/FormDefinitionArrayConverterTest.php+0 −1
- typo3/sysext/form/Tests/Functional/Service/DatabaseServiceTest.php+0 −3
- typo3/sysext/form/Tests/Unit/Domain/FormElements/AbstractFormElementTest.php+3 −4
- typo3/sysext/form/Tests/Unit/Domain/FormElements/AbstractSectionTest.php+3 −3
- typo3/sysext/frontend/Tests/Functional/Controller/ShowImageControllerTest.php+0 −1
- typo3/sysext/frontend/Tests/Functional/Rendering/SvgImageRenderingTest.php+0 −2
- typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php+17 −14
- typo3/sysext/frontend/Tests/Unit/ContentObject/ImageContentObjectTest.php+0 −14
- typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php+6 −8
- typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php+1 −2
- typo3/sysext/install/Tests/Unit/FolderStructure/DefaultFactoryTest.php+4 −4
- typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php+0 −20
- typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php+1 −25
- typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php+1 −16
- typo3/sysext/install/Tests/Unit/FolderStructure/StructureFacadeTest.php+4 −7
- typo3/sysext/scheduler/Classes/CronCommand/CronCommand.php+6 −10
Show 5 more files
- typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php+6 −6
- typo3/sysext/scheduler/Tests/Unit/CronCommand/CronCommandTest.php+1 −8
- typo3/sysext/scheduler/Tests/Unit/CronCommand/NormalizeCommandTest.php+9 −101
- typo3/sysext/workspaces/Tests/Functional/Service/WorkspaceServiceTest.php+1 −11
- typo3/sysext/workspaces/Tests/Unit/Domain/Model/WorkspaceRecordTest.php+4 −13
Review log 1114
-
Christian Kuhn uploaded patch set 1 12/04/24, 00:12
-
core-ci voted on patch set 1 V +1 12/04/24, 00:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70552
-
Christian Kuhn uploaded patch set 2
V +112/04/24, 00:23 -
core-ci voted on patch set 2 V +1 12/04/24, 00:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70553
-
Christian Kuhn uploaded patch set 3
V +112/04/24, 15:47 -
core-ci voted on patch set 3 V +1 12/04/24, 15:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70597
-
Stefan Bürk voted on patch set 3 CR +1 V +1 12/04/24, 16:16
-
Garvin Hicking voted on patch set 3 CR +1 V +1 12/04/24, 17:07
-
Christian Kuhn voted on patch set 3 CR +2 V +2 12/04/24, 18:12
-
Christian Kuhn merged patch set 4 12/04/24, 18:12
-
Andreas Kienast commented on patch set 4 12/05/24, 07:00
-
Markus Klein commented on patch set 4 12/05/24, 09:09
ExtensionTest.php:29ReplyIt does test something. It would fail if the creation fails. But there's no need to run a dedicated assertion, PHP would fail here anyway. -
Christian Kuhn commented on patch set 4 12/05/24, 09:11
ExtensionTest.php:29ReplyYeah. I'm partially biased on this as well. The thing is, this test actually does something: It verifies the subject does *not* fail / throw. There is not much benefit, though, and the test below does the same and goes a bit further, so another option would have been to fully remove this one. I used both solutions throughout the patch. -
Benjamin Franzke commented on patch set 4 12/05/24, 09:35
ExtensionTest.php:29Reply UnresolvedI think this actually pops up, because this patch removes valid assertions because they are statically seen always true. I think we should ask ourselves if we really want to do that. Unit tests are actually here to pin behavior. That something returns an array or implements an interface is behavior. Removing an assertion like `assertIsArray` allows to change `array` to `?array` codewise, while the unit test previously would have intervened because the method is expected to always return an `array`. In other words: I am worried that we are making the tests less stringent just because they describe the current situation – but I think that's what unit tests are (also) about.
ExtensionTest.php:29