68191[TASK] Enable phpstan parameter checkFunctionArgumentTypes
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Richard Haeser +1
-
Verified V +2 Done
- Benni Mack +2
- Richard Haeser +1
- TYPO3com +1 CI
- core-ci +1 CI
Issues 1
Files 62
- Build/gitlab-ci/nightly/integrity.yml+0 −11
- Build/gitlab-ci/pre-merge/integrity.yml+1 −13
- Build/phpstan.level5.neon+2 −2
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php+1 −1
- typo3/sysext/backend/Classes/Controller/File/FileController.php+7 −2
- typo3/sysext/backend/Classes/Controller/File/ImageProcessController.php1+1 −1
- typo3/sysext/backend/Classes/Controller/Wizard/TableController.php+1 −1
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php+2 −2
- typo3/sysext/backend/Classes/Controller/PageLayoutController.php+1 −1
- typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php1+1 −1
- typo3/sysext/backend/Classes/Form/Element/FileInfoElement.php1+1 −1
- typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php1+1 −1
- typo3/sysext/backend/Classes/Template/Components/ButtonBar.php+1 −1
- typo3/sysext/backend/Classes/Utility/BackendUtility.php1+1 −1
- typo3/sysext/belog/Classes/Controller/BackendLogController.php1+1 −1
- typo3/sysext/core/Classes/Authentication/Mfa/Provider/RecoveryCodesProvider.php+2 −2
- typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php1+1 −1
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+1 −1
- typo3/sysext/core/Classes/Charset/CharsetConverter.php+1 −1
- typo3/sysext/core/Classes/Crypto/PasswordHashing/Pbkdf2PasswordHash.php1+1 −1
Show 42 more files
- typo3/sysext/core/Classes/Database/QueryGenerator.php+2 −2
- typo3/sysext/core/Classes/ExpressionLanguage/Resolver.php1+2 −0
- typo3/sysext/core/Classes/Html/HtmlParser.php+2 −2
- typo3/sysext/core/Classes/Imaging/IconRegistry.php1+2 −2
- typo3/sysext/core/Classes/Resource/Collection/FileCollectionRegistry.php+1 −1
- typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php+1 −1
- typo3/sysext/core/Classes/Resource/Index/ExtractorRegistry.php+1 −1
- typo3/sysext/core/Classes/Resource/Rendering/RendererRegistry.php+1 −1
- typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php+1 −1
- typo3/sysext/core/Classes/Resource/Service/ImageProcessingService.php1+1 −0
- typo3/sysext/core/Classes/Resource/TextExtraction/TextExtractorRegistry.php+1 −1
- typo3/sysext/core/Classes/Resource/SynchronizeFolderRelations.php+2 −2
- typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php+1 −1
- typo3/sysext/core/Classes/Routing/Route.php+1 −1
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php+1 −1
- typo3/sysext/extbase/Classes/Persistence/ClassesConfigurationFactory.php+1 −1
- typo3/sysext/extbase/Classes/Property/PropertyMapper.php+1 −1
- typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php+1 −1
- typo3/sysext/extensionmanager/Classes/Controller/ListController.php1+2 −0
- typo3/sysext/extensionmanager/Classes/Domain/Model/Extension.php+1 −1
- typo3/sysext/extensionmanager/Classes/Remote/TerExtensionRemote.php+2 −2
- typo3/sysext/filelist/Classes/FileFacade.php+1 −1
- typo3/sysext/filelist/Classes/FileList.php1+3 −3
- typo3/sysext/fluid/Classes/ViewHelpers/Be/Labels/CshViewHelper.php+1 −1
- typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php+1 −1
- typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentDataProcessor.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+4 −4
- typo3/sysext/indexed_search/Classes/Controller/SearchController.php+2 −2
- typo3/sysext/install/Classes/Controller/InstallerController.php+1 −1
- typo3/sysext/install/Classes/Updates/RowUpdater/WorkspaceNewPlaceholderRemovalMigration.php1+2 −2
- typo3/sysext/install/Classes/Updates/DatabaseRowsUpdateWizard.php+1 −1
- typo3/sysext/linkvalidator/ext_tables.php+1 −1
- typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php+1 −1
- typo3/sysext/scheduler/Classes/Task/FileStorageExtractionTask.php1+3 −0
- typo3/sysext/scheduler/Classes/Task/FileStorageIndexingTask.php1+3 −0
- typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php+1 −1
- typo3/sysext/workspaces/Classes/Controller/Remote/ActionHandler.php+4 −0
- typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php+2 −2
- typo3/sysext/workspaces/Classes/Controller/ReviewController.php+1 −1
- typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php+1 −1
- phpstan.neon+316 −0
Review log 1838
Show 513 earlier messages
-
Daniel Goerz uploaded patch set 1 03/05/21, 10:53
-
Daniel Goerz wrote 03/05/21, 10:53
Topic set to phpstan -
TYPO3com voted on patch set 1 V -1 03/05/21, 11:00 Completed build in 07m 00s on Fri, 5 Mar, 11:00 AM Test Summary: 32742 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9860
-
core-ci voted on patch set 1 V -1 03/05/21, 11:06 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1193
-
Daniel Goerz uploaded patch set 2 03/06/21, 08:37
-
TYPO3com voted on patch set 2 V -1 03/06/21, 08:43 Completed build in 05m 56s on Sat, 6 Mar, 08:43 AM Test Summary: 32742 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9874
-
core-ci voted on patch set 2 V -1 03/06/21, 08:48 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1210
-
Daniel Goerz uploaded patch set 3 03/06/21, 09:02
-
TYPO3com voted on patch set 3 V -1 03/06/21, 09:09 Completed build in 06m 44s on Sat, 6 Mar, 09:09 AM Test Summary: 32742 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9875
-
core-ci voted on patch set 3 V -1 03/06/21, 09:16 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1211
-
Daniel Goerz rebased onto patch set 4 03/08/21, 15:19
-
TYPO3com voted on patch set 4 V -1 03/08/21, 15:25 Completed build in 05m 38s on Mon, 8 Mar, 03:25 PM Test Summary: 32638 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9932
-
core-ci voted on patch set 4 V -1 03/08/21, 15:29 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1276
-
Daniel Goerz uploaded patch set 5 03/08/21, 16:17
-
TYPO3com voted on patch set 5 V -1 03/08/21, 16:23 Completed build in 05m 40s on Mon, 8 Mar, 04:23 PM Test Summary: 32638 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9933
-
core-ci voted on patch set 5 V -1 03/08/21, 16:27 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1277
-
Daniel Goerz uploaded patch set 6 03/09/21, 08:26
-
TYPO3com voted on patch set 6 V -1 03/09/21, 08:31 Completed build in 05m 24s on Tue, 9 Mar, 08:31 AM Test Summary: 32638 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9956
-
core-ci voted on patch set 6 V -1 03/09/21, 08:38 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1304
-
Daniel Goerz rebased onto patch set 7 03/09/21, 15:08
-
TYPO3com voted on patch set 7 V -1 03/09/21, 15:18 Completed build in 10m 00s on Tue, 9 Mar, 03:18 PM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9975
-
core-ci voted on patch set 7 V -1 03/09/21, 15:22 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1330
-
Daniel Goerz uploaded patch set 8 03/09/21, 16:22
-
core-ci voted on patch set 8 V -1 03/09/21, 16:32 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1335
-
TYPO3com voted on patch set 8 V -1 03/09/21, 16:45 Completed build in 21m 29s on Tue, 9 Mar, 04:45 PM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9980
-
Daniel Goerz uploaded patch set 9 03/11/21, 10:10
-
Daniel Goerz updated the commit message in patch set 10 03/11/21, 10:15
-
Daniel Goerz commented on patch set 10 03/11/21, 10:16
This change is ready for review. -
TYPO3com voted on patch set 9 V +1 03/11/21, 10:18 Completed build in 07m 06s on Thu, 11 Mar, 10:18 AM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10046
-
TYPO3com voted on patch set 10 V +1 03/11/21, 10:23 Completed build in 07m 35s on Thu, 11 Mar, 10:23 AM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10047
-
core-ci voted on patch set 9 V +1 03/11/21, 10:23 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1410
-
core-ci voted on patch set 10 V +1 03/11/21, 10:25 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1411
-
Richard Haeser voted on patch set 10 V +1 CR +1 03/11/21, 13:00
-
Benni Mack voted on patch set 10 V +2 CR +2 03/11/21, 20:02
-
Benni Mack merged patch set 11 03/11/21, 20:02
-
Benni Mack commented on patch set 11 03/11/21, 20:03
great work. -
Sascha Egerer commented on patch set 11 03/12/21, 07:37
ImageProcessController.php:57Unresolved`GeneralUtility::locationHeaderUrl()` can now get an empty string and so it will return an empty string. RedirectResponse will then create a `Location` header without a value as the value is an empty string. That means the header will not work at all. I think this will hide an deeper issue and it does maybe more sense to fail here if getPublicUrl is empty. What do you think?InlineRecordContainer.php:392UnresolvedCreating an image tag with a src "/" does not make that much sense. If there is no public url the image tag should not be created at allFileInfoElement.php:92UnresolvedSame here. If there is no public url it does not make sense to create the link. The a tag should just be skipped while the text can still be rendered.ShortcutButton.php:329Unresolved`?:` should not be used as it is an unsafe comparison. PHPStan will also complain about that in a stricter mode. But I'm not sure if there is a TYPO3 core related decision about that. So I'm fine if with it if most people say we should go this way.BackendUtility.php:1064UnresolvedNo public url = no image tagBackendLogController.php:230Unresolved`$timestampDay` can be false. Passing false as array key does not make sense. as this will be casted to `0` which could end up in unexpected results (maybe not in this case but in general). So i would just add a `$timestampDay !== false` in the if condition belowAbstractUserAuthentication.php:826UnresolvedCalling getRawUserByUid with 0 does not make sense. So we should first check if it's a valid valuePbkdf2PasswordHash.php:208I think the 4 should maybe still be kept as 4th parameter but this can be done in another patch (which is not really required IMO).Resolver.php:67UnresolvedThis annotation should be moved up to line 50IconRegistry.php:476UnresolvedWe can do an early return here which is cleaner. $iconContent = file_get_contents($absoluteIconDeclarationPath); if (empty($iconContent)) { return; }ImageProcessingService.php:64UnresolvedThis is the wrong place to fix that issue. `$this->processedFileRepository->findByUid()` must be fixed to return the correct type. The annotation in line 57 should then also be removed. We should prevent those annotations as much as possible as they are "hardcore overwrites". If the called method is changed this place can never be detected by a static code linter as broken as we say "ignore whatever the method says it does return. It's always of this type". So... is like shooting in our own foot :)ListController.php:211UnresolvedSame here. `findAll` must be fixed to return the correct type.FileList.php:809Unresolvedno source = no image tagWorkspaceNewPlaceholderRemovalMigration.php:72UnresolvedI would do the cast once in the first line of foreach so the array does also use a string key.FileStorageExtractionTask.php:54UnresolvedIMO we should throw more specific exceptions but thats not a must.FileStorageIndexingTask.php:46UnresolvedIMO we should throw more specific exceptions but thats not a must. -
Daniel Goerz commented on patch set 11 03/12/21, 08:25
Hi Sascha, thanks for your Feedback. The main goal was to finally activate the option to stop new code from introducing new errors. I agree that the code could be improved further. Especially the ->getPublicUrl() null cases. I’ll have a look into that once phpstan runs with the activated argument type checking on PHP 8 again. In the meantime feel free to push patches improving code quality, always welcome.