Review main Merged

65664[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:core Database

Sascha Egerer CR +2 V +2 Normal +139 −37 updated 10/29/20, 20:42

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 11

Review log 1926

Show 1 earlier messages
  1. Sascha Egerer uploaded patch set 1 09/09/20, 17:15

  1. Sascha Egerer wrote 09/09/20, 17:25

    Topic set to phpstan
  2. Sascha Egerer updated the commit message in patch set 2 09/09/20, 17:25

  3. TYPO3com voted on patch set 1 V +1 09/09/20, 18:09 Completed build in 46m 37s on Wed, 9 Sep, 06:09 PM Test Summary: 73173 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5429

  4. Oliver Klee voted on patch set 2 CR +1 09/09/20, 18:26

  5. Daniel Goerz updated the commit message in patch set 3 09/10/20, 08:53

  6. TYPO3com voted on patch set 3 V +1 09/10/20, 18:07 Completed build in 54m 28s on Thu, 10 Sep, 06:07 PM Test Summary: 73173 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5502

  7. Oliver Klee voted on patch set 3 CR +1 09/10/20, 19:12

  8. Alexander Schnitzler uploaded patch set 4 10/06/20, 15:54

  9. Alexander Schnitzler commented on patch set 4 10/06/20, 15:55

    phpstan.neon:164 Unresolved

    Those are all ignored since QueryGenerator and QueryView are deprecated and we don't need to fix deprecated code.
  10. Alexander Schnitzler uploaded patch set 5 10/06/20, 16:07

  11. TYPO3com voted on patch set 4 V +1 10/06/20, 16:07 Completed build in 12m 41s on Tue, 6 Oct, 04:07 PM Test Summary: 73784 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6288

  12. Alexander Schnitzler uploaded patch set 6 10/06/20, 16:15

  13. Daniel Goerz voted on patch set 6 V +1 CR +1 10/06/20, 16:16

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

  15. TYPO3com voted on patch set 6 V -1 10/06/20, 16:28 Completed build in 12m 44s on Tue, 6 Oct, 04:28 PM Test Summary: 73451 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6291

  16. TYPO3com voted on patch set 6 V +1 10/06/20, 18:20 Completed build in 2h 17m 18s on Tue, 6 Oct, 06:20 PM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6291

  17. Oliver Klee voted on patch set 6 CR +1 10/06/20, 21:27

  18. Benni Mack commented on patch set 6 10/19/20, 20:10

    RelationHandler.php:581

    do we need this double casting?

    RelationHandler.php:657

    same here. we could just use (string)?

    RelationHandler.php:899

    same here.

    RelationHandler.php:1557

    seriously? I mean.... looking at the PHP.net docs: "Returns the combined array, FALSE if the number of elements for each array isn't equal."
  19. Daniel Goerz commented on patch set 6 CR -1 10/21/20, 07:45

    on it

    RelationHandler.php:581 Reply Unresolved

    Yes, you are right, (string) should do

    RelationHandler.php:657 Reply

    Ack

    RelationHandler.php:899 Reply

    Ack

    RelationHandler.php:1557 Reply Unresolved

    Yes, this is "stupid". It is a known flaw in phpstan's evaluation of array_combine: https://github.com/phpstan/phpstan/issues/1580 When we enable the rule for the whole core, we only have 2 options: * "Fix" this non-issue (I made it ?: []) * Ignore the errors that result from it (currently 2 in this place, but I bet there are more places in core) I would prefer the first solution because once phpstan recognizes that the above code can never return false, there is another rule that will tell us the the first part of :? can never be false and thus the operator is superfluous. So that we can find this later on where it is kind of gone if we add an error exception for this.
  20. Daniel Goerz uploaded patch set 7 10/21/20, 07:47

  21. Daniel Goerz voted on patch set 7 V +1 CR +1 10/21/20, 07:50

  22. TYPO3com voted on patch set 7 V +1 10/21/20, 07:59 Completed build in 11m 49s on Wed, 21 Oct, 07:59 AM Test Summary: 73488 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6710

  23. Oliver Klee voted on patch set 7 CR +1 10/22/20, 20:58

  24. Benni Mack voted on patch set 7 V +2 CR +2 10/29/20, 20:41

  25. Benni Mack merged patch set 8 10/29/20, 20:42