Review main Merged

65466[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:backend

Alexander Schnitzler CR +2 V +2 Normal +49 −43 updated 11/06/20, 10:50

Commit message

This patch fixes incompatible type usage in function arguments
and is preparatory work for introducing native type hints and
strict mode in all core files.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Daniel Goerz +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Benni Mack +2
    • Daniel Goerz +1
    • TYPO3com +1 CI

Issues 1

Files 14

Review log 3246

Show 1621 earlier messages
  1. Alexander Schnitzler uploaded patch set 1 08/26/20, 13:27

  2. Alexander Schnitzler wrote 08/26/20, 13:28

    Topic set to phpstan
  3. TYPO3com voted on patch set 1 V -1 08/26/20, 14:23 Completed build in 45m 19s on Wed, 26 Aug, 02:23 PM Test Summary: 2 of 72603 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4987

  4. TYPO3com voted on patch set 1 V +1 08/27/20, 09:02 Completed build in 20h 10m 01s on Thu, 27 Aug, 09:02 AM Test Summary: 73092 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4987

  5. Jörg Bösche commented on patch set 1 CR -1 08/31/20, 11:03

    InputColorPickerElement.php:152

    Looks funny. IMO, should be changed to $attributes['maxlength'] = (string)$config['max'];

    InputDateTimeElement.php:154

    $attributes['maxlength'] = (string)$maxLength; The $attributes variables is used to render the html output. Type of string is ok for me.

    InputDateTimeElement.php:174

    Shouldn't it be like this? $attributes['data-date-min-date'] = (string)((int)$config['range']['lower'] * 1000);

    InputLinkElement.php:173 Unresolved

    Double cast? (string)$maxLength shoud work.

    InputTextElement.php:252

    Double cast? (string)$config['range']['lower'] shoud work or do we have to take into account that the value can be empty and then it will cast to 0? Example: (string)(int)'' -> (int)'' -> 0 --> (string)0 -> '0'
  6. Alexander Schnitzler commented on patch set 1 08/31/20, 12:08

    InputColorPickerElement.php:152 Reply Unresolved

    Well, yeah. (int)$config['max'] > 0 ensures that we have a numeric string but it's hard to see.

    InputDateTimeElement.php:154 Reply Unresolved

    Yep, the idea was to ensure we have a numeric string.

    InputDateTimeElement.php:174 Reply

    Yes.

    InputTextElement.php:252 Reply Unresolved

    The idea is the same like in the cases before. I want to ensure we have a numeric string. Here, we only have an isset check which is true for all types. That's why I would want to keep both type casts here.
  7. Jörg Bösche commented on patch set 1 V +1 CR +1 08/31/20, 13:51

    okay, thanks for clarification. Verified on master (v11-dev)
  8. Alexander Schnitzler commented on patch set 1 CR -1 09/02/20, 09:46

    > Patch Set 1: Verified+1 Code-Review+1 > > okay, thanks for clarification. > > Verified on master (v11-dev) wait, there are some

    InputDateTimeElement.php:174 Reply Unresolved

    Wait, this needs to be fixed.
  9. Alexander Schnitzler uploaded patch set 2 09/02/20, 10:05

  10. TYPO3com voted on patch set 2 V +1 09/02/20, 10:17 Completed build in 12m 06s on Wed, 2 Sep, 10:17 AM Test Summary: 73162 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5127

  11. Jörg Bösche voted on patch set 2 V +1 CR +1 09/03/20, 10:08

  12. Alexander Schnitzler updated the commit message in patch set 3 09/03/20, 15:41

  13. TYPO3com voted on patch set 3 V +1 09/03/20, 15:53 Completed build in 11m 58s on Thu, 3 Sep, 03:53 PM Test Summary: 73182 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5186

  14. Oliver Klee commented on patch set 3 09/04/20, 08:35

    FormInlineAjaxController.php:683

    We need to cast $domObjectId to a string here.

    AbstractItemProvider.php:776

    I'd prefer array<string, string> for $tableToTranslation.

    StandardPreviewRendererResolver.php:86 Unresolved

    This should go above line 76 instead.

    MetaInformation.php:79

    This annotation does not seem necessary with the cast below anymore to me.

    ModuleTemplate.php:543

    Shouldn't this be is_string && !== '' ?

    PagePositionMap.php:533

    Why this change?
  15. Alexander Schnitzler commented on patch set 3 CR -1 09/04/20, 08:50

    FormInlineAjaxController.php:683 Reply

    Will check, phpstan should have detected that as well.

    AbstractItemProvider.php:776 Reply Unresolved

    Will change that.

    MetaInformation.php:79 Reply Unresolved

    Will check

    ModuleTemplate.php:543 Reply Unresolved

    Yeah, that's a reason I hate if conditions on non booleans. You never know what the intended check actually is.

    PagePositionMap.php:533 Reply Unresolved

    That is indeed a good question I will try to answer. I prepared those patches over a timeframe of about 4 weeks and I don't remember. ^^
  16. Alexander Schnitzler uploaded patch set 4 09/04/20, 09:12

  17. Alexander Schnitzler commented on patch set 4 09/04/20, 09:13

    FormInlineAjaxController.php:683 Reply Unresolved

    Hmm, nope. According to the phpdocs, $domObjectId is a string. What is changed here is the return type.
  18. TYPO3com voted on patch set 4 V +1 09/04/20, 09:29 Completed build in 13m 15s on Fri, 4 Sep, 09:29 AM Test Summary: 73200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5220

  19. Oliver Klee voted on patch set 4 CR +1 09/04/20, 09:45

  20. Jörg Bösche voted on patch set 4 CR +1 09/07/20, 08:05

  21. Alexander Schnitzler uploaded patch set 5 10/06/20, 13:15

  1. TYPO3com voted on patch set 5 V +1 10/06/20, 13:30 Completed build in 14m 49s on Tue, 6 Oct, 01:30 PM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6277

  2. Oliver Klee voted on patch set 5 CR +1 10/06/20, 13:42

  3. Daniel Goerz rebased onto patch set 6 10/17/20, 08:54

  4. TYPO3com voted on patch set 6 V +1 10/17/20, 09:05 Completed build in 11m 15s on Sat, 17 Oct, 09:05 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6594

  5. Daniel Goerz uploaded patch set 7 10/17/20, 09:08

  6. Daniel Goerz uploaded patch set 8 10/17/20, 09:09

  7. Daniel Goerz uploaded patch set 9 10/17/20, 09:14

  8. Daniel Goerz uploaded patch set 10 10/17/20, 09:17

  9. Daniel Goerz uploaded patch set 11 10/17/20, 09:19

  10. Oliver Klee voted on patch set 11 CR +1 10/17/20, 09:24

  11. TYPO3com voted on patch set 8 V +1 10/17/20, 09:35 Completed build in 23m 01s on Sat, 17 Oct, 09:35 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6598

  12. TYPO3com voted on patch set 7 V +1 10/17/20, 09:36 Completed build in 23m 23s on Sat, 17 Oct, 09:36 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6597

  13. TYPO3com voted on patch set 9 V +1 10/17/20, 09:39 Completed build in 13m 04s on Sat, 17 Oct, 09:39 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6600

  14. TYPO3com voted on patch set 10 V +1 10/17/20, 09:50 Completed build in 24m 29s on Sat, 17 Oct, 09:50 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6602

  15. TYPO3com voted on patch set 11 V +1 10/17/20, 09:54 Completed build in 27m 40s on Sat, 17 Oct, 09:53 AM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6603

  16. Daniel Goerz uploaded patch set 12 10/18/20, 11:57

  17. Daniel Goerz voted on patch set 12 V +1 CR +1 10/18/20, 12:03

  18. TYPO3com voted on patch set 12 V +1 10/18/20, 12:11 Completed build in 13m 49s on Sun, 18 Oct, 12:11 PM Test Summary: 73812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6626

  19. Oliver Klee voted on patch set 12 CR +1 10/18/20, 12:41

  20. Daniel Goerz uploaded patch set 13 10/19/20, 21:46

  21. Daniel Goerz voted on patch set 13 V +1 CR +1 10/19/20, 21:47

  22. Oliver Klee voted on patch set 13 CR +1 10/19/20, 21:50

  23. TYPO3com voted on patch set 13 V +1 10/19/20, 22:03 Completed build in 16m 48s on Mon, 19 Oct, 10:03 PM Test Summary: 73839 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6674

  24. Benni Mack voted on patch set 13 V +2 CR +2 11/06/20, 10:14

  25. Daniel Goerz merged patch set 14 11/06/20, 10:50