84190[TASK] Remove unused local variables
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Georg Ringer +1
-
Verified V +2 Done
- Benni Mack +2
- Georg Ringer +1
- core-ci +1 CI
Issues 1
Files 41
- typo3/sysext/backend/Classes/Controller/LinkController.php3+0 −1
- typo3/sysext/backend/Classes/Controller/MfaAjaxController.php+1 −1
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php+1 −1
- typo3/sysext/backend/Classes/Form/FieldWizard/SelectIcons.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessPlaceholders.php5+1 −0
- typo3/sysext/backend/Classes/Form/NodeFactory.php2+1 −0
- typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php+1 −1
- typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php+1 −1
- typo3/sysext/beuser/Classes/Service/UserInformationService.php+1 −1
- typo3/sysext/core/Classes/Database/Query/QueryBuilder.php+1 −1
- typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php+3 −3
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php+1 −1
- typo3/sysext/core/Classes/Database/DriverMiddlewareService.php+0 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+1 −1
- typo3/sysext/core/Classes/DependencyInjection/MessengerMiddlewarePass.php8+0 −1
- typo3/sysext/core/Classes/Error/DebugExceptionHandler.php+1 −1
- typo3/sysext/core/Classes/Html/HtmlCropper.php+1 −2
- typo3/sysext/core/Classes/Html/HtmlParser.php+1 −1
- typo3/sysext/core/Classes/Mail/Rfc822AddressesParser.php+1 −1
- typo3/sysext/core/Classes/Package/PackageManager.php+1 −1
Show 21 more files
- typo3/sysext/core/Classes/Page/PageRenderer.php+1 −1
- typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php+0 −1
- typo3/sysext/core/Classes/Routing/Enhancer/PageTypeDecorator.php+1 −2
- typo3/sysext/core/Classes/Utility/ArrayUtility.php+1 −1
- typo3/sysext/core/Classes/Utility/GeneralUtility.php3+5 −6
- typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php13+18 −3
- typo3/sysext/extbase/Classes/Reflection/ClassSchema.php+3 −0
- typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php+0 −1
- typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+2 −2
- typo3/sysext/indexed_search/Classes/Utility/IndexedSearchUtility.php+1 −1
- typo3/sysext/lowlevel/Classes/Command/MissingRelationsCommand.php+2 −2
- typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php+2 −2
- typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php+1 −1
- typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php+1 −1
- typo3/sysext/tstemplate/Classes/Controller/AbstractTemplateModuleController.php+0 −1
- typo3/sysext/tstemplate/Classes/Controller/TemplateRecordsOverviewController.php+1 −1
- typo3/sysext/webhooks/Classes/DependencyInjection/WebhookCompilerPass.php+0 −1
- typo3/sysext/workspaces/Classes/Controller/Remote/MassActionHandler.php+2 −2
- typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php+2 −2
- typo3/sysext/workspaces/Classes/Service/GridDataService.php+0 −2
Review log 4151
Show 2126 earlier messages
-
Simon Schaufelberger uploaded patch set 1 05/11/24, 12:21
-
Simon Schaufelberger commented on patch set 1 05/11/24, 12:24
All places have been found through Phpstorm's inspection "unused local variable" -
Simon Schaufelberger commented on patch set 1 05/11/24, 12:26
One line has been skipped as this one has a separate issue: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84189 -
core-ci voted on patch set 1 V -1 05/11/24, 12:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57517
-
Simon Schaufelberger uploaded patch set 2
V -105/11/24, 12:35 -
core-ci voted on patch set 2 V +1 05/11/24, 12:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57518
-
Simon Schaufelberger uploaded patch set 3
V +105/11/24, 12:41 -
core-ci voted on patch set 3 V +1 05/11/24, 12:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57519
-
Ayke Halder commented on patch set 3 05/13/24, 13:27
I started to review the changes and came to a general assumption: In case of an `foreach` loop the named index might be intersting for debugging in case the index has some meaning/purpose on the data-object. Indexes which are just a counting number are of course unnecessary in case of a `foreach` loop when they are not in use.TcaColumnsProcessPlaceholders.php:35For debugging it might be nice to have `$fieldName` around.TcaFlexProcess.php:87For debugging it might be nice to have `$dataStructureSheetName` around.TcaFlexProcess.php:92For debugging it might be nice to have `$dataStructureFieldName` around.NodeFactory.php:170It might be nice to have `$priority` around: for debugging and in general to see what's the index' purpose. -
Willi Wehmeier commented on patch set 3 05/13/24, 13:28
LinkController.php:84In case of an Exception thrown in the try block `$link` will be undefined here. -
Oliver Klee voted on patch set 3 V +1 05/13/24, 13:34
-
Ayke Halder commented on patch set 3 CR -1 05/13/24, 13:36
MessengerMiddlewarePass.php:67Calling `findDefinition($serviceName)` throws ServiceNotFoundException if the service definition does not exist. So calling this has a purpose and cannot be removed. Storing this inside a variable that is never used has no purpose. Maybe change `$service = $container->findDefinition($serviceName);` to `$container->findDefinition($serviceName);` -
Ayke Halder commented on patch set 3 05/13/24, 13:38
LinkController.php:84ReplyIn case of an Exception the catch-block does a `return` by itself. -
Willi Wehmeier commented on patch set 3 05/13/24, 13:40
LinkController.php:84ReplyYou're right. :) -
Ayke Halder commented on patch set 3 CR 0 05/13/24, 15:15
MessengerMiddlewarePass.php:67ReplyLooking into this again: * `$container->findTaggedServiceIds($this->tagName)` calls `ContainerBuilder::getDefinitions()` * `$container->findDefinition($serviceName)` make some checks and might throw `ServiceCircularReferenceException`. In the end it also calls `ContainerBuilder::getDefinitions()` So we might actually remove the call to `ContainerBuilder::findDefinitions()`. Someone with experience in Symfony Dependency injection must decide on this. -
Simon Schaufelberger commented on patch set 3 05/13/24, 16:20
TcaColumnsProcessPlaceholders.php:35ReplyDoneTcaFlexProcess.php:87ReplyDoneTcaFlexProcess.php:92ReplyDoneNodeFactory.php:170ReplyDoneMessengerMiddlewarePass.php:67ReplyDone -
Simon Schaufelberger uploaded patch set 4
V +105/13/24, 16:21 -
Simon Schaufelberger commented on patch set 4 05/13/24, 16:23
MessengerMiddlewarePass.php:67Replynot done yet -
core-ci voted on patch set 4 V +1 05/13/24, 16:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57632
-
Oliver Klee voted on patch set 4 V +1 05/13/24, 17:08
-
Ayke Halder commented on patch set 4 CR -1 05/13/24, 17:53
GeneralUtility.php:1836Must be `$key => $value` here. As either one is used by `${$valueName}` with ``` $valueName = 'value'; if ($order === 'mtime') { asort($files); $valueName = 'key'; } ``` -
Simon Schaufelberger uploaded patch set 5
CR -1V +105/13/24, 21:57 -
core-ci voted on patch set 5 V +1 05/13/24, 22:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57651
-
Simon Schaufelberger commented on patch set 5 05/14/24, 07:46
GeneralUtility.php:1836Replygood catch! This shows that this method is not fully covered. I've added a test for this case. -
Ayke Halder commented on patch set 5 05/14/24, 07:53
Great, you are improving test coverage!GeneralUtility.php:1836ReplyDoneGeneralUtilityTest.php:2481Remove this test-directory again: `GeneralUtility::rmdir($path, true);` -
Oliver Klee commented on patch set 5 05/14/24, 07:55
GeneralUtilityTest.php:2481ReplyNote: This then needs to happen in `tearDown`, not in the test method itself, to ensure that the directory is removed even if the test fails or if an exception gets thrown.
-
Ayke Halder commented on patch set 5 05/14/24, 07:59
GeneralUtilityTest.php:2481ReplySo this test actually does not need to remove its test-directory: `createVersionNumberedFilenameKeepsInvalidAbsolutePathInFrontendAndAddsQueryString` -
Ayke Halder commented on patch set 5 05/14/24, 08:01
GeneralUtilityTest.php:2481ReplyAnother test that does not need to remove its test-directory: `getAllFilesAndFoldersInPathReturnsArrayWithMd5Keys` -
Ayke Halder commented on patch set 5 05/14/24, 08:14
Move deletion of test-directories into test `tearDown`.GeneralUtilityTest.php:2469Use `getTestDirectory` here to have path registered for deletion upon test ending: `$path = $this->getTestDirectory();`GeneralUtilityTest.php:2481ReplyDoneGeneralUtilityTest.php:3153`rmdir` can be removed. directory is created via `getTestDirectory` and therby already registered for deletion in `tearDown` upon test ending.GeneralUtilityTest.php:3588Register path for tear-down upon test ending: `$this->testFilesToDelete[] = $testFileDirectory;`GeneralUtilityTest.php:3604Might not be needed anymore - directory registered for deletion on tear-down. -
Simon Schaufelberger commented on patch set 5 05/14/24, 10:31
GeneralUtilityTest.php:2469ReplyDoneGeneralUtilityTest.php:3153ReplyDoneGeneralUtilityTest.php:3588ReplyDoneGeneralUtilityTest.php:3604ReplyDone -
Simon Schaufelberger uploaded patch set 6
V +105/14/24, 10:31 -
core-ci voted on patch set 6 V -1 05/14/24, 10:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57705
-
Simon Schaufelberger uploaded patch set 7
V -105/14/24, 21:09 -
core-ci voted on patch set 7 V +1 05/14/24, 21:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57733
-
Simon Schaufelberger uploaded patch set 8
V +105/15/24, 21:04 -
core-ci voted on patch set 8 V +1 05/15/24, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57789
-
Ayke Halder commented on patch set 8 05/16/24, 12:13
MessengerMiddlewarePass.php:67ReplyIn general I'd keep the call for now and just add a comment here: ``` /* * TODO: check if additonal call to `findDefinition` is actually necessary. * Especially check if there is a valid case where `ServiceCircularReferenceException` might get thrown. */ ``` But as this is going into `main` only: Remove the call to `findDefinition` and be prepared for some breaking. If it breaks, fix the problem again and ship a specific test-case for the breaking behaviour. -
Benjamin Franzke commented on patch set 8 05/24/24, 10:33
MessengerMiddlewarePass.php:67ReplyThis is for sure a copy&paste left-over and can be removed. The service is available (as it is listed by `findTaggedServiceIds`), no explicit call to `findDefinition()` is needed. -
Simon Schaufelberger commented on patch set 8 05/24/24, 10:47
MessengerMiddlewarePass.php:67Replythank you! -
Simon Schaufelberger commented on patch set 8 05/24/24, 10:47
MessengerMiddlewarePass.php:67ReplyDone -
Simon Schaufelberger uploaded patch set 9
V +105/24/24, 10:47 -
core-ci voted on patch set 9 V +1 05/24/24, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58149
-
Oliver Klee voted on patch set 9 V +1 05/24/24, 10:59
-
Oliver Klee voted on patch set 9 CR +1 05/24/24, 11:21
-
Simon Schaufelberger uploaded patch set 10
CR +1V +107/09/24, 21:01 -
core-ci voted on patch set 10 V +1 07/09/24, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61260
-
Georg Ringer voted on patch set 10 CR +1 V +1 07/10/24, 08:54
-
Benni Mack commented on patch set 10 07/11/24, 12:08
TcaColumnsProcessPlaceholders.php:35why is this needed? -
Simon Schaufelberger commented on patch set 10 07/11/24, 12:24
TcaColumnsProcessPlaceholders.php:35ReplyYou mean the annotation or the unused variable "fieldName"? Ayke said that it would be helpful to leave it, because I removed it before. The annotation just makes it clear that $fieldName is not in use but just there for debugging purpose -
Benni Mack commented on patch set 10 CR +2 V +2 07/11/24, 15:22
TcaColumnsProcessPlaceholders.php:35Replythe annotation. really not a fan to leave such comments for tools that we don't use in CI. -
Benni Mack merged patch set 11 07/11/24, 15:22