Review main Merged

68886[TASK] Shorten GeneralUtility::_GP() with PHP 7 syntax

crell CR +2 V +2 Easy +5 −8 updated 05/03/21, 10:47

Commit message

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Benni Mack +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2023

  1. crell uploaded patch set 1 04/27/21, 15:51

  2. Mathias Brodala commented on patch set 1 CR -1 04/27/21, 15:56

    GeneralUtility.php:118

    This is a change in behavior. Before all empty-ish values did lead to the next check in chain to be executed. Now only null does this. Simple example: $_POST['foo'] = ''; $_GET['foo'] = 'whoops'; Before: _GP('foo') returns '' After: _GP('foo') returns 'whoops'
  3. Mathias Brodala commented on patch set 1 04/27/21, 15:57

    GeneralUtility.php:118 Reply

    Correction: Before: _GP('foo') returns 'whoops' After: _GP('foo') returns ''
  4. core-ci voted on patch set 1 V +1 04/27/21, 16:03 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10742

  5. crell commented on patch set 1 04/27/21, 16:29

    GeneralUtility.php:118 Reply

    Really? I just tried it on 3v4l and it looks like it still works the same: https://3v4l.org/spVZH
  6. Simon Gilli commented on patch set 1 CR +1 04/27/21, 16:40

    GeneralUtility.php:118 Reply

    To me it looks like every case is handled properly within the unit tests see https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php#L122-L157. So this change should be fine.
  7. Oliver Hader commented on patch set 1 CR +1 04/27/21, 16:43

    GeneralUtility.php:118 Reply

    Yepp, just wanted to point to unit tests as well... ;-) https://3v4l.org/DVp4L looks good to me ('C' is actually the scenario Mathias mentioned)
  8. Oliver Hader commented on patch set 1 04/27/21, 16:44

    @crell: Welcome & Congrats to your first contribution to the TYPO3 core! 🎉
  9. Oliver Hader voted on patch set 1 CR 0 04/27/21, 16:47

  10. Oliver Hader commented on patch set 1 CR -1 04/27/21, 16:49

    GeneralUtility.php:118 Reply

    Okay, had the first close look now... there's an issue with `empty` ('', 0, '', null, false - being used as param). → https://3v4l.org/oRWue → Tests are not complete
  11. crell uploaded patch set 2 04/27/21, 21:35

  12. crell commented on patch set 2 04/27/21, 21:36

    Unresolved

    Figures my first time out would hit a testing gap. :-) I restored the initial if-check, and added a test case to the existing data provider.
  13. core-ci voted on patch set 2 V +1 04/27/21, 21:48 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10798

  14. Simon Gilli voted on patch set 2 V +1 CR +1 04/28/21, 14:14

  15. Simon Gilli commented on patch set 2 04/28/21, 14:16

    GeneralUtility.php:118 Reply

    Yes, you're right. Looks like I didn't check the tests carefully enough.
  16. Christian Kuhn voted on patch set 2 V +1 CR +1 04/28/21, 19:06

  17. Benni Mack updated the commit message in patch set 3 04/29/21, 08:44

  18. Christian Kuhn voted on patch set 3 V +1 CR +1 04/29/21, 08:51

  19. core-ci voted on patch set 3 V +1 04/29/21, 09:01 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10881

  20. Benni Mack voted on patch set 3 V +2 CR +2 04/29/21, 11:30

  21. Benni Mack merged patch set 4 04/29/21, 11:31

  22. Oliver Hader voted on patch set 4 CR +1 05/03/21, 10:47

  23. Oliver Hader voted on patch set 4 CR +2 05/03/21, 10:47