63810[TASK] Set phpstan parameter checkPhpDocMissingReturn to true
Commit message
Review
-
Code review CR +2 Done
- Daniel Goerz +2
- Oliver Klee +1
- Frank Nägler +1
-
Verified V +2 Done
- Daniel Goerz +2
- Frank Nägler +1
- TYPO3com +1 CI
Issues 1
Files 19
- Build/phpstan.level2.neon+1 −1
- typo3/sysext/backend/Classes/Middleware/LockedBackendGuard.php+2 −0
- typo3/sysext/core/Classes/Database/SoftReferenceIndex.php9+16 −6
- typo3/sysext/core/Classes/Html/HtmlParser.php+1 −0
- typo3/sysext/core/Classes/Resource/AbstractRepository.php+3 −0
- typo3/sysext/core/Classes/Resource/InaccessibleFolder.php+1 −0
- typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php+3 −1
- typo3/sysext/core/Classes/Utility/GeneralUtility.php4+5 −1
- typo3/sysext/form/Classes/ViewHelpers/Form/DatePickerViewHelper.php+2 −0
- typo3/sysext/form/Classes/ViewHelpers/Form/TimePickerViewHelper.php+2 −0
- typo3/sysext/indexed_search/Classes/Controller/SearchController.php+3 −2
- typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php1+3 −1
- typo3/sysext/indexed_search/Classes/Utility/IndexedSearchUtility.php+3 −1
- typo3/sysext/indexed_search/Classes/Indexer.php+2 −0
- typo3/sysext/indexed_search/Classes/Lexer.php+2 −0
- typo3/sysext/redirects/Classes/Service/RedirectService.php+2 −0
- typo3/sysext/reports/Classes/Controller/ReportController.php2+1 −1
- typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php+3 −1
- phpstan.neon+6 −0
Review log 2839
Show 814 earlier messages
-
Alexander Schnitzler uploaded patch set 1 03/20/20, 11:22
-
Alexander Schnitzler wrote 03/20/20, 11:23
Topic set to phpstan -
TYPO3com voted on patch set 1 V -1 03/20/20, 12:01 Completed build in 32m 39s on Fri, 20 Mar, 12:01 PM Test Summary: 24 of 72604 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1493
-
Alexander Schnitzler uploaded patch set 2 03/20/20, 12:59
-
TYPO3com voted on patch set 2 V -1 03/20/20, 13:23 Completed build in 19m 28s on Fri, 20 Mar, 01:23 PM Test Summary: 3 of 71671 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1500
-
TYPO3com commented on patch set 2 03/20/20, 13:38 Completed build in 53m 55s on Fri, 20 Mar, 01:38 PM Test Summary: 3 of 71671 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1500
-
TYPO3com commented on patch set 2 03/20/20, 13:44 Completed build in 1h 34m 47s on Fri, 20 Mar, 01:44 PM Test Summary: 3 of 71671 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1500
-
TYPO3com commented on patch set 2 03/20/20, 14:12 Completed build in 14m 00s on Fri, 20 Mar, 02:12 PM Test Summary: 3 of 71671 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1504
-
Alexander Schnitzler uploaded patch set 3 03/20/20, 14:14
-
TYPO3com voted on patch set 3 V +1 03/20/20, 14:25 Completed build in 11m 08s on Fri, 20 Mar, 02:25 PM Test Summary: 72120 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1505
-
Alexander Schnitzler commented on patch set 3 03/20/20, 18:28
This change is ready for review. -
Alexander Schnitzler commented on patch set 3 03/20/20, 18:29
Unresolved
Yes, I know, the issue number is missing. Will be added later. For now I'd like to get actual feedback on the code changes. -
Oliver Klee commented on patch set 3 03/20/20, 18:54
SoftReferenceIndex.php:104Why this change?SoftReferenceParserHook.php:42Why this change?CrawlerHook.php:586UnresolvedWhy this change?ReportController.php:180To me, the @return annotation seems to be incorrect instead, and it should be void. -
Alexander Schnitzler commented on patch set 3 03/21/20, 10:17
SoftReferenceIndex.php:104ReplyThis change has been made to make it possible to use a proper return type hint in the future (: ?array) and to be able to have a better check on the receiving side than just if (empty($array['elements'])).SoftReferenceParserHook.php:42Reply UnresolvedSame reason like for the parent method.ReportController.php:180ReplyAck
-
Alexander Schnitzler uploaded patch set 4 03/21/20, 10:18
-
Alexander Schnitzler uploaded patch set 5 03/21/20, 10:20
-
Oliver Klee commented on patch set 5 03/21/20, 10:49
SoftReferenceIndex.php:104ReplyI'd prefer to have the proper annotations and return values first here (without a change in the actual or expected behavior), and move changes of type to separate change sets. This will allow us to separate "cleanup and strictness" from (potentially breaking) type changes. Would that be okay with you? -
TYPO3com voted on patch set 4 V +1 03/21/20, 10:50 Completed build in 25m 02s on Sat, 21 Mar, 10:50 AM Test Summary: 72225 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1535
-
TYPO3com voted on patch set 5 V +1 03/21/20, 10:52 Completed build in 27m 57s on Sat, 21 Mar, 10:52 AM Test Summary: 72225 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1536
-
Alexander Schnitzler commented on patch set 5 03/21/20, 13:10
SoftReferenceIndex.php:104Reply UnresolvedI am fine with that and I expected feedback like yours. I will adjust the patch and we will adjust the actual types in 11.0. -
Alexander Schnitzler uploaded patch set 6 03/21/20, 13:25
-
Alexander Schnitzler commented on patch set 6 03/21/20, 13:26
SoftReferenceIndex.php:165What do you think about this now? If being totally strict, we should either annotate void and leave the code as is or return null, right? -
TYPO3com voted on patch set 6 V -1 03/21/20, 13:36 Completed build in 10m 57s on Sat, 21 Mar, 01:36 PM Test Summary: 12 of 72715 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1540
-
Oliver Klee commented on patch set 6 03/21/20, 13:45
SoftReferenceIndex.php:165Reply UnresolvedYes, this then should be array|null (and then keep the added return null). -
Oliver Klee commented on patch set 6 03/21/20, 13:48
Generally, for methods that (at least sometimes) return something, I'd prefer @return someType|null over @return someType|void so there always is a return value: Usually, when a method is called, the caller does not differentiate between "there is a return value" and "there is no return value". And technically (to PHP, not to PhpStan or a human reader), returning null and void is the same thing. -
Alexander Schnitzler commented on patch set 6 03/21/20, 14:03
> Patch Set 6: > > Generally, for methods that (at least sometimes) return something, I'd prefer @return someType|null over @return someType|void so there always is a return value: Usually, when a method is called, the caller does not differentiate between "there is a return value" and "there is no return value". And technically (to PHP, not to PhpStan or a human reader), returning null and void is the same thing. Alright, we are on the same side then. I'll leave the patch is now. -
Alexander Schnitzler uploaded patch set 7 03/21/20, 16:53
-
TYPO3com voted on patch set 7 V +1 03/21/20, 17:04 Completed build in 10m 50s on Sat, 21 Mar, 05:04 PM Test Summary: 72231 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1548
-
Oliver Klee commented on patch set 7 03/21/20, 17:25
SoftReferenceIndex.php:104I think this can stay as is. Or am I missing something?GeneralUtility.php:3225I'd prefer null here instead of void so always something gets returned.SoftReferenceParserHook.php:42I'd prefer this to stay unchanged. -
Alexander Schnitzler commented on patch set 7 03/22/20, 07:44
SoftReferenceIndex.php:104ReplyThat's what I asked you about in private. We have tests for this method, checking for null as return type.GeneralUtility.php:3225ReplyHmm, in a controller action some patch sets before you had the opposite argument. I personally prefer void over null though.SoftReferenceParserHook.php:42ReplySoo comment in parent class please. -
Oliver Klee commented on patch set 7 03/22/20, 12:27
SoftReferenceIndex.php:104Reply UnresolvedOh, so (with the old behavior) we have three possible return types: - array - bool (false) (which currently is not covered by tests AFAICS) - void (or null) I fail to see how with the old code null can be returned. Do you have an idea?GeneralUtility.php:3225ReplyI can see where I contradicted myself. ;-) I'll try to make this more explicit: 1. By convention, Extbase controller actions either return a response, a string, or void. We should keep this and not change the void to null. 2. In general, I think that a mixture of "only sometime return a value, and sometimes return void" is a bad thing. So we should change the void to null in cases where something is returned. 3. The Extbase convention mentioned above has a higher priority than my code cleanliness efforts listed in 2. Does this make sense, and would it okay with you to use this as a rule of thumb for this changeset?SoftReferenceParserHook.php:42Reply UnresolvedI'm confused: AFAICS, findRef in both SoftReferenceParserHook as well as SoftReferenceIndex return array|bool. What am I missing here? What part of the comment in the parent class are you referring to? -
Alexander Schnitzler commented on patch set 7 03/22/20, 12:46
GeneralUtility.php:3225ReplyI am ok with this rule until I force people to return a ResponseInterface in actions. ;) -
Alexander Schnitzler uploaded patch set 8 03/22/20, 13:27
-
TYPO3com voted on patch set 8 V +1 03/22/20, 13:43 Completed build in 13m 56s on Sun, 22 Mar, 01:43 PM Test Summary: 72231 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1578
-
Oliver Klee commented on patch set 8 CR +1 03/22/20, 13:47
Neat! -
Alexander Schnitzler commented on patch set 8 03/26/20, 12:23
ping -
Frank Nägler voted on patch set 8 V +1 CR +1 03/27/20, 11:30
-
Daniel Goerz voted on patch set 8 V +2 CR +2 03/27/20, 15:36
-
Daniel Goerz merged patch set 9 03/27/20, 15:36