Review main Merged

65463[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:install

Alexander Schnitzler CR +2 V +2 Normal +65 −52 updated 09/07/20, 09:27

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
    • Jörg Bösche +1
  • Verified V +2 Done
    • Benni Mack +2
    • Daniel Goerz +1
    • Jörg Bösche +1
    • TYPO3com +1 CI

Issues 1

Files 18

Review log 1418

  1. Alexander Schnitzler uploaded patch set 1 08/26/20, 13:18

  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:16 Completed build in 57m 14s on Wed, 26 Aug, 02:16 PM Test Summary: 54 of 72919 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4984

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

  5. Jörg Bösche commented on patch set 1 CR -1 08/27/20, 10:59

    SessionService.php:73

    According to the documentation, the second method parameter must be a boolean value. https://www.php.net/manual/de/session.configuration.php#ini.session.cookie-httponly

    UpgradeWizardsService.php:52

    Thats very hard to read. Is it possible to move the "$stream" variable definition before the condition instead of defining inside of the condition.

    UpgradeWizardsService.php:410

    Should moved after the rewind($stream) as $messageBody = (string)stream_get_contents($stream) and used in then and else case. The redundancies of casting and stream_get_contents() have been resolved.
  6. Alexander Schnitzler commented on patch set 1 08/28/20, 07:41

    SessionService.php:73 Reply Unresolved

    That's not correct. The configuration value is boolean(ish) but ini_set only excepts strings as 2nd parameter. This is the error of phpstan: > ------ --------------------------------------------------------------- > Line Classes/Service/SessionService.php > ------ --------------------------------------------------------------- > 73 Parameter #2 $newvalue of function ini_set expects string, true given. > ------ --------------------------------------------------------------- And here the docs for ini_set: https://www.php.net/manual/en/function.ini-set.php > ini_set ( string $varname , string $newvalue ) : string

    UpgradeWizardsService.php:52 Reply Unresolved

    Reading this change after a couple of days I think it's too invasive anyway. Throwing an exception changes the logic here and I tend to revert this code block and add this part to the ignored phpstan errors for now.

    UpgradeWizardsService.php:410 Reply Unresolved

    Yes, we can do so but my idea with those phpstan patches is actually to be as little invasive as possible to be able to easily backport those patches. Introducing a variable is cleaner but it results in more line changes and diffs.
  7. Jörg Bösche commented on patch set 1 V +1 CR +1 08/28/20, 07:55

    Okay, thanks for the feedback. Verified this on version 11-dev (master).
  8. Oliver Klee voted on patch set 1 CR +1 08/28/20, 10:35

  9. Alexander Schnitzler uploaded patch set 2 09/02/20, 10:17

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

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

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

  13. TYPO3com voted on patch set 3 V +1 09/03/20, 16:07 Completed build in 22m 46s on Thu, 3 Sep, 04:07 PM Test Summary: 73182 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5188

  14. Oliver Klee voted on patch set 3 CR +1 09/04/20, 07:50

  15. Daniel Goerz voted on patch set 3 V +1 CR +1 09/05/20, 13:30

  16. Jörg Bösche voted on patch set 3 V +1 CR +1 09/07/20, 07:23

  17. Benni Mack voted on patch set 3 V +2 CR +2 09/07/20, 09:26

  18. Benni Mack merged patch set 4 09/07/20, 09:27