Review main Merged

73304[TASK] Streamline functions returning $GLOBALS['BE_USER']

Torben Hansen CR +2 V +2 Hard +76 −419 updated 02/05/22, 21:43

Commit message

Many classes in TYPO3 have a function called
getBackendUser() or getBackendUserAuthentication(). The
function definition is not always equal and some functions
have a return type or doc comment and others do not.

This patch streamlines the functions as following:

* They must always use a return type declaration
* They must not contain a doc comment header

Also, some superfluous override of getBackendUser()
have been removed.

Additionally the parameter type declaration for
$backendUserAuthentication in

* BeforeHistoryRollbackStartEvent
* AfterHistoryRollbackFinishedEvent
* RecordHistoryRollback

have been adapted to be nullable.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 99

Show 79 more files

Review log 1621

  1. Torben Hansen uploaded patch set 1 02/05/22, 11:36

  2. Oliver Klee commented on patch set 1 02/05/22, 11:48

    Looks very good. I've added one comment.

    BeforeHistoryRollbackStartEvent.php:56

    If |null is allowed, we should also make the native type declaration nullable.
  3. core-ci voted on patch set 1 V -1 02/05/22, 11:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23056

  4. Torben Hansen uploaded patch set 2 02/05/22, 12:08

  5. Torben Hansen commented on patch set 1 02/05/22, 12:09

    BeforeHistoryRollbackStartEvent.php:56 Reply

    Done. Found 2 additional nullable type declarations of the same type and updated the patch/commit message.
  6. Oliver Klee voted on patch set 2 CR +1 02/05/22, 12:12

  7. core-ci voted on patch set 2 V -1 02/05/22, 12:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23064

  8. Torben Hansen uploaded patch set 3 02/05/22, 12:36

  9. Oliver Klee voted on patch set 3 CR +1 02/05/22, 12:46

  10. core-ci voted on patch set 3 V -1 02/05/22, 12:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23069

  11. Christian Kuhn commented on patch set 3 CR -1 02/05/22, 12:54

    RichTextElement.php:401

    this is used in the class.
  12. Torben Hansen commented on patch set 3 02/05/22, 13:02

    RichTextElement.php:401 Reply

    This class extends TYPO3\CMS\Backend\Form\Element\AbstractFormElement, where getBackendUser() is declared. So IMO this is a superfluous overwrite of the function or am I missing something?
  13. Christian Kuhn commented on patch set 3 CR 0 02/05/22, 13:20

    RichTextElement.php:401 Reply

    Ack
  14. Torben Hansen uploaded patch set 4 02/05/22, 14:04

  15. core-ci voted on patch set 4 V -1 02/05/22, 15:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23071

  16. Oliver Klee commented on patch set 4 02/05/22, 15:16

    The build failure seems to be caused by a full file system on the GitLab runner.
  17. core-ci voted on patch set 4 V +1 02/05/22, 19:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23071

  18. Christian Kuhn voted on patch set 4 V +1 CR +1 02/05/22, 19:13

  19. Nikita Hovratov voted on patch set 4 V +1 CR +1 02/05/22, 21:37

  20. Christian Kuhn voted on patch set 4 V +2 CR +2 02/05/22, 21:43

  21. Christian Kuhn merged patch set 5 02/05/22, 21:43