Review main Merged

85673[TASK] Enhance TYPO3\CMS\Core\Type\Map capabilities

Oliver Hader CR +2 V +2 Normal +69 −0 updated 08/19/24, 11:41

Commit message

This change introduces the following enhancements:

* `Map::keys(): array` resolves all keys of a map
* `Map::values(): array` resolves all values of a map
* `Map::assign(?Map): void` incorporates entries of other map

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Stefan Bürk +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Stefan Bürk +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1215

  1. Oliver Hader uploaded patch set 1 08/18/24, 12:48

  2. core-ci voted on patch set 1 V +1 08/18/24, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63703

  3. Garvin Hicking voted on patch set 1 CR +1 V +1 08/18/24, 19:40

  4. Stefan Bürk commented on patch set 1 08/19/24, 07:32

    Map.php:116

    Can we make this not nullable ? Or what is the reason to allow passing null ?
  5. Oliver Hader commented on patch set 1 08/19/24, 08:28

    Map.php:116 Reply

    The reason is "convenience", to reduce conditional checks in the application code. For instance: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85632/22/typo3/sysext/core/Classes/Security/ContentSecurityPolicy/MutationRepository.php#104 ``` // $disposedTarget = new Map(); $disposedTarget->assign($this->staticMutations[$scope] ?? null); $disposedTarget->assign($resolutions[$scope] ?? null); ``` would look like this, if nullable would not be allowed ``` // $disposedTarget = new Map(); if (isset($this->staticMutations[$scope])) { $disposedTarget->assign($this->staticMutations[$scope]); } if (isset($resolutions[$scope])) { $disposedTarget->assign($resolutions[$scope]); } ```
  6. Andreas Kienast voted on patch set 1 CR +1 V +1 08/19/24, 09:40

  7. Stefan Bürk commented on patch set 1 CR +1 V +1 08/19/24, 10:41

    Map.php:116 Reply

    Acknowledged
  8. Oliver Hader commented on patch set 2 CR +1 V +1 08/19/24, 10:46

    Published edit on patch set 1.
  9. core-ci voted on patch set 2 V -1 08/19/24, 10:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63760

  10. Oliver Hader commented on patch set 3 V -1 08/19/24, 11:22

    Published edit on patch set 2.
  11. core-ci voted on patch set 3 V +1 08/19/24, 11:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63762

  12. Stefan Bürk voted on patch set 3 CR +1 V +1 08/19/24, 11:32

  13. Andreas Kienast voted on patch set 3 CR +1 V +1 08/19/24, 11:41

  14. Oliver Hader voted on patch set 3 CR +2 V +2 08/19/24, 11:41

  15. Oliver Hader merged patch set 4 08/19/24, 11:41