63569[TASK] Fix php doc comments reported by phpstan level 2
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Klee +1
- Andreas Kienast +1
-
Verified V +2 Done
- Benni Mack +2
- Andreas Kienast +1
- TYPO3com +1 CI
Issues 1
Files 79
- typo3/sysext/adminpanel/Classes/Service/ConfigurationService.php+1 −1
- typo3/sysext/backend/Classes/Authentication/PasswordReset.php+1 −1
- typo3/sysext/backend/Classes/Controller/BackendController.php+1 −1
- typo3/sysext/backend/Classes/Controller/PageLayoutController.php+1 −1
- typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCheckboxItems.php+1 −1
- typo3/sysext/backend/Classes/Template/ModuleTemplate.php+1 −1
- typo3/sysext/core/Classes/Authentication/AuthenticationService.php7+1 −1
- typo3/sysext/core/Classes/Cache/Backend/Typo3DatabaseBackend.php+1 −1
- typo3/sysext/core/Classes/Collection/AbstractRecordCollection.php+1 −1
- typo3/sysext/core/Classes/Collection/SortableCollectionInterface.php+1 −1
- typo3/sysext/core/Classes/Context/Context.php+1 −1
- typo3/sysext/core/Classes/Core/Bootstrap.php+1 −1
- typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php+2 −2
- typo3/sysext/core/Classes/Database/Query/QueryBuilder.php+12 −12
- typo3/sysext/core/Classes/Database/QueryView.php+1 −1
- typo3/sysext/core/Classes/DataHandling/History/RecordHistoryStore.php+5 −5
- typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php+1 −1
- typo3/sysext/core/Classes/DataHandling/Model/RecordStateFactory.php+1 −1
Show 59 more files
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+1 −2
- typo3/sysext/core/Classes/DependencyInjection/EnvVarProcessor.php+1 −1
- typo3/sysext/core/Classes/FormProtection/FormProtectionFactory.php+2 −2
- typo3/sysext/core/Classes/Http/MiddlewareStackResolver.php+1 −1
- typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariant.php4+2 −2
- typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariantCollection.php2+2 −2
- typo3/sysext/core/Classes/Imaging/IconRegistry.php+1 −1
- typo3/sysext/core/Classes/LinkHandling/TelephoneLinkHandler.php+1 −1
- typo3/sysext/core/Classes/LinkHandling/UrlLinkHandler.php+1 −1
- typo3/sysext/core/Classes/Mail/MailMessage.php2+1 −1
- typo3/sysext/core/Classes/Package/AbstractServiceProvider.php+2 −2
- typo3/sysext/core/Classes/Package/PackageManager.php+1 −1
- typo3/sysext/core/Classes/Resource/Search/Result/DriverFilteredSearchResult.php+1 −1
- typo3/sysext/core/Classes/Resource/File.php+1 −1
- typo3/sysext/core/Classes/Resource/Folder.php+2 −2
- typo3/sysext/core/Classes/Resource/ResourceFactory.php+2 −2
- typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php+1 −1
- typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php+1 −1
- typo3/sysext/core/Classes/Site/Entity/Site.php+1 −1
- typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeNode.php+1 −1
- typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php+2 −2
- typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php+1 −1
- typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php+1 −1
- typo3/sysext/core/Classes/Utility/GeneralUtility.php4+4 −4
- typo3/sysext/dashboard/Classes/DashboardRepository.php+1 −1
- typo3/sysext/extbase/Classes/Object/Container/Container.php4+2 −2
- typo3/sysext/extbase/Classes/Object/ObjectManager.php2+1 −1
- typo3/sysext/extbase/Classes/Validation/Validator/GenericObjectValidator.php+1 −1
- typo3/sysext/extensionmanager/Classes/Controller/AbstractController.php+1 −1
- typo3/sysext/extensionmanager/Classes/Domain/Model/DownloadQueue.php+1 −1
- typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php2+2 −2
- typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php+2 −2
- typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php+1 −1
- typo3/sysext/filelist/Classes/Controller/File/CreateFolderController.php+1 −1
- typo3/sysext/filelist/Classes/FileList.php+1 −1
- typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php+0 −1
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php+2 −2
- typo3/sysext/frontend/Classes/DataProcessing/LanguageMenuProcessor.php+2 −2
- typo3/sysext/frontend/Classes/Http/RequestHandler.php+1 −1
- typo3/sysext/frontend/Classes/Middleware/SiteBaseRedirectResolver.php+1 −1
- typo3/sysext/frontend/Classes/Page/CacheHashCalculator.php+1 −1
- typo3/sysext/indexed_search/Classes/ViewHelpers/PageBrowsingResultsViewHelper.php+1 −1
- typo3/sysext/indexed_search/Classes/Indexer.php+1 −1
- typo3/sysext/indexed_search/Classes/Lexer.php+1 −1
- typo3/sysext/install/Classes/Command/UpgradeWizardRunCommand.php+2 −2
- typo3/sysext/install/Classes/Controller/BackendModuleController.php+1 −1
- typo3/sysext/install/Classes/Http/NotFoundRequestHandler.php+0 −1
- typo3/sysext/install/Classes/Report/EnvironmentStatusReport.php+1 −1
- typo3/sysext/install/Classes/Service/LateBootService.php+2 −2
- typo3/sysext/install/Classes/Service/LocalConfigurationValueService.php+1 −1
- typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php+1 −1
- typo3/sysext/install/Classes/UpgradeAnalysis/DocumentationFile.php+3 −3
- typo3/sysext/recycler/Classes/Domain/Model/DeletedRecords.php+1 −1
- typo3/sysext/redirects/Classes/Service/RedirectService.php+2 −2
- typo3/sysext/scheduler/Classes/Task/ExecuteSchedulableCommandAdditionalFieldProvider.php+2 −2
- typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php5+1 −1
- typo3/sysext/workspaces/Classes/Service/StagesService.php+3 −3
- phpstan.neon+9 −0
Review log 2126
Show 1 earlier messages
-
Alexander Schnitzler uploaded patch set 1 03/06/20, 19:57
-
Alexander Schnitzler wrote 03/06/20, 19:57
Topic set to phpstan -
TYPO3com voted on patch set 1 V -1 03/06/20, 20:08 Completed build in 10m 56s on Fri, 6 Mar, 08:08 PM Test Summary: 71565 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1053
-
TYPO3com voted on patch set 1 V +1 03/06/20, 20:16 Completed build in 30m 27s on Fri, 6 Mar, 08:16 PM Test Summary: 72072 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1053
-
Benni Mack commented on patch set 1 03/06/20, 20:45
AuthenticationService.php:355the additional space before "@param" - is that correct?CropVariant.php:185same here.CropVariant.php:209same here.CropVariantCollection.php:157same here.MailMessage.php:243same here.GeneralUtility.php:3416same here.GeneralUtility.php:3477same here.Container.php:133same here.Container.php:181same here.ObjectManager.php:106same here.InstallUtility.php:156same here. -
Alexander Schnitzler commented on patch set 1 CR -1 03/06/20, 22:41
AuthenticationService.php:355ReplyAh, shit. regex gone wrong. -
Alexander Schnitzler uploaded patch set 2 03/07/20, 07:37
-
Alexander Schnitzler commented on patch set 2 03/07/20, 07:38
AuthenticationService.php:355ReplyAckCropVariant.php:185ReplyAckCropVariant.php:209ReplyAckCropVariantCollection.php:157ReplyAckMailMessage.php:243ReplyAckGeneralUtility.php:3416ReplyAckGeneralUtility.php:3477ReplyAckContainer.php:133ReplyAckContainer.php:181ReplyAckObjectManager.php:106ReplyAckInstallUtility.php:156ReplyAck -
TYPO3com voted on patch set 2 V -1 03/07/20, 07:50 Completed build in 12m 35s on Sat, 7 Mar, 07:50 AM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1068
-
Alexander Schnitzler rebased onto patch set 3 03/07/20, 07:58
-
Alexander Schnitzler uploaded patch set 4 03/07/20, 07:59
-
TYPO3com voted on patch set 3 V -1 03/07/20, 08:09 Completed build in 10m 43s on Sat, 7 Mar, 08:09 AM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1069
-
TYPO3com voted on patch set 4 V +1 03/07/20, 08:12 Completed build in 13m 07s on Sat, 7 Mar, 08:12 AM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1070
-
Claus Due commented on patch set 4 03/07/20, 08:58
WorkspacePreview.php:360Maybe we should instead consider deleting these redundant phpdocs? * All arguments and return types are strict * The method name is clear * The method description adds nothing to the method name and return types As a rule of thumb, I think our new pragma is to only add phpdoc if there are additional specifics to note about a function. For example, if it is capable of returning different or nullable values, it sometimes helps to explain which input arguments or context parameters would cause one or the other return types (such as: "if $arg1 and $arg2 are both null then null is returned" - which adds information that the argument- and return types alone cannot convey). Less phpdoc to maintain, fewer "functionless" lines of code - and same green result when running phpstan or other analysis tools. -
Alexander Schnitzler commented on patch set 4 03/07/20, 16:10
WorkspacePreview.php:360ReplyIm fine with that. -
Andreas Kienast commented on patch set 4 03/08/20, 06:38
AuthenticationService.php:355To my understanding this represents an array as follows: [ [0, 4711], [1, $this], [2, 'and so on'] ] Shouldn't this be "array<mixed>" only? -
Claus Due commented on patch set 4 03/08/20, 10:12
Quick question: have we moved away from notations like `mixed[]` in favor of `array<mixed>`? I'm personally a huge fan of the former (which also allows multidim arrays to be annotated) and strongly dislike the latter (which afaik doesn't). @Andy no, that's not the case. If `array<int,mixed>` represents a multidim array then `array<mixed>` would also represent a multidim array. I have no clue how the `<>` syntax can be used to identify a multidim array but in the `[]` notation you would have `mixed[][]`. -
Alexander Schnitzler commented on patch set 4 03/08/20, 10:20
AuthenticationService.php:355ReplyI agree on the definition. That's why I understand as well. Regarding the question: phpstan thinks otherwise because array<mixed> only defines that you have a list of mixed values with an undefined key type, hence being some kind of dictionary. array<int,mixed> states, that we actually deal with integer keys which the splat operator provides. See https://3v4l.org/UcKo2 -
Alexander Schnitzler commented on patch set 4 03/08/20, 10:21
WorkspacePreview.php:360ReplyHi Claus, I talked to Benni and we agreed on removing useless php doc blocks rather automatically with a rector. It's easier to do it in one go and be able to do it repetitively. -
Claus Due commented on patch set 4 03/08/20, 10:26
AuthenticationService.php:355ReplyWhat does phpstan say about "mixed[]"? I'm not sure that indicating the type of key conveys meaningful information that the "splat" operator does not already provide (since you can't splat a non-numeric array). Depending on subclass compatibility requirements we might also want to add a type hint for "...$params" in addition to the splat.WorkspacePreview.php:360ReplySounds like a plan! Can you ping me when that rector rule is made? I'm very interested :) I'd use it myself on my own code but I'm honestly not aware how rector would determine that the phpdoc is redundant if it has a single line of text above the @param/@return (to rector, wouldn't that look like a non-redundant comment then?) -
Alexander Schnitzler commented on patch set 4 03/08/20, 11:02
AuthenticationService.php:355Reply UnresolvedWith array|mixed[], phpstan says: > PHPDoc tag @param for parameter $params with type array is not subtype of native type array<int, mixed> And with just mixed[] it says the same. I don't know if that can be considered a bug or a missing missing on the phpstan end but my opinion is, that adding the int to indicate the key type does not harm at all. tbh, my goal is not to be 100% sure about everything now. As long as I don't disagree with phpstan I want to push its integration forward to ave cleaner incoming patches. I am all in for more cleanup in the future but every phpstan check we have in active in bamboo right now is a good one imo. -
Alexander Schnitzler commented on patch set 4 03/08/20, 11:06
WorkspacePreview.php:360Reply Unresolved> Sounds like a plan! Can you ping me when that rector rule is made? I'm very interested :) Of course. > I'd use it myself on my own code but I'm honestly not aware how rector would determine that the phpdoc is redundant if it has a single line of text above the @param/@return (to rector, wouldn't that look like a non-redundant comment then?) the good thing is, that if we write a custom rector, we can determine that ourselves. Like: Remove all @param we have a type hint for and that don't have a parameter description. That's quite specific and therefore I think we need to write that rector ourselves. -
Oliver Klee commented on patch set 4 CR +1 03/08/20, 13:24
<3 -
Andreas Kienast voted on patch set 4 V +1 CR +1 03/08/20, 14:21
-
Benni Mack voted on patch set 4 V +2 CR +2 03/08/20, 19:37
-
Benni Mack merged patch set 5 03/08/20, 19:37