Review main Abandoned

65465[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:core

Alexander Schnitzler CR 0 V 0 Hard +522 −454 updated 09/22/20, 12:17

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 0
  • Verified V 0

Issues 1

Files 116

Show 96 more files

Review log 1622

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

  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 53s on Wed, 26 Aug, 02:23 PM Test Summary: 1376 of 71940 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4986

  4. TYPO3com commented on patch set 1 08/27/20, 09:04 Completed build in 20h 12m 43s on Thu, 27 Aug, 09:04 AM Test Summary: 1825 of 73577 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4986

  5. Alexander Schnitzler uploaded patch set 2 08/28/20, 09:02

  6. TYPO3com voted on patch set 2 V -1 08/28/20, 09:14 Completed build in 11m 28s on Fri, 28 Aug, 09:14 AM Test Summary: 73092 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5027

  7. Alexander Schnitzler uploaded patch set 3 08/31/20, 08:23

  8. TYPO3com voted on patch set 3 V +1 08/31/20, 08:34 Completed build in 11m 20s on Mon, 31 Aug, 08:34 AM Test Summary: 73146 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5074

  9. Jörg Bösche voted on patch set 3 CR +1 08/31/20, 09:49

  10. Jörg Bösche commented on patch set 3 V +1 09/01/20, 08:15

    No problems using the backend could be found. Verified on master (v11-dev) as admin user.
  11. Alexander Schnitzler updated the commit message in patch set 4 09/03/20, 15:49

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

  13. Oliver Klee commented on patch set 4 09/04/20, 10:35

    ExpressionBuilder.php:20 Unresolved

    Is this used anywhere in this file?

    PageRenderer.php:1394 Unresolved

    This contradicts the @param annotation above - it should either be both Package or both PackageInterface. Anayway, do we still need these two annotation if the @param is updated as above?

    DriverRegistry.php:51 Unresolved

    string|null

    FileIndexRepository.php:98 Unresolved

    Wouldn't an int cast suffice here?

    FileSearchQuery.php:74 Unresolved

    Please let's move this assignment out of the condition.

    FileSearchQuery.php:143 Unresolved

    Please let's move this assignment out of the condition.

    CsvUtility.php:43 Unresolved

    Can we please split this into two statements? I find the combined ? and ?? operators really hard to wrap my head around.

    GeneralUtility.php:46 Unresolved

    Where is this used?
  14. Oliver Klee voted on patch set 4 CR -1 09/04/20, 10:37

  15. Alexander Schnitzler uploaded patch set 5 09/04/20, 10:56

  16. TYPO3com voted on patch set 5 V +1 09/04/20, 11:12 Completed build in 14m 28s on Fri, 4 Sep, 11:12 AM Test Summary: 73200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5230

  17. Oliver Klee voted on patch set 5 CR +1 09/04/20, 12:44

  18. Jörg Bösche voted on patch set 5 V +1 CR +1 09/07/20, 07:45

  19. Sascha Egerer commented on patch set 5 CR -1 09/09/20, 15:32

    Just reviewed a first set of changes

    BackendUserAuthentication.php:1300

    Don't get that code. $alternativeWebmountPoint is casted to int in 1298. Calling intExplode on a integer does not make sense at all, right?

    FileBackend.php:110

    1. if `file_get_contents()` returns `false` something really went wrong. I would go for a log message here in that case and do an early return. I think $this->frozen should also not be set to `true` in that case. 2. second parameter for unserialize should be set to `['allowed_classes' => false]` as it does only contain an array of booleans

    PdoBackend.php:286

    if $sql is empty or false we can do an early return instead. $sql = file($pathAndFilename, FILE_IGNORE_NEW_LINES & FILE_SKIP_EMPTY_LINES); if (empty($sql)) { return ''; }
  20. Alexander Schnitzler commented on patch set 5 09/09/20, 16:36

    BackendUserAuthentication.php:1300 Reply Unresolved

    Yep, me neither. That's a part where I simply made phpstan happy. I didn't find any documentation on pageTree_temporaryMountPoint but I guess it's really an int and we can drop the whole intExplode here.

    FileBackend.php:110 Reply Unresolved

    Agree on 1). I fits to the scope if this patch. 2) is a different issue imo.

    PdoBackend.php:286 Reply Unresolved

    Yep, saves some cpu cycles.
  21. Sascha Egerer commented on patch set 5 09/09/20, 17:29

    I've split up this patch into smaller parts as discussed in slack. So i would opt to close abandon this one
  22. Alexander Schnitzler abandoned the change 09/22/20, 12:17

    Patch has been split into smaller chunks