Review main Merged

73457[TASK] Cleanup code in PSR-14 events

Torben Hansen CR +2 V +2 Expert +388 −1747 updated 02/14/22, 12:10

Commit message

* Use constructor property promotion where appropriate
* Use typed properties
* Remove doc comments for functions with a PHP return type
  where applicable
* Remove doc comments for typed properties where applicable
* Remove doc comments for constructors where applicable
* Setters must return void

Applicable is, if a doc comment has only been used for type hinting
or if the property or function is self explaining.

Review

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

Issues 1

Files 112

Show 92 more files

Review log 1317

  1. Torben Hansen uploaded patch set 1 02/12/22, 18:44

  2. core-ci voted on patch set 1 V +1 02/12/22, 18:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23466

  3. Nikita Hovratov commented on patch set 1 02/12/22, 20:17

    AfterPageColumnsSelectedForLocalizationEvent.php:34

    You can safely remove the @var annotation here, too. Just leave the comment.

    AlterTableDefinitionStatementsEvent.php:27

    @var array can be removed.

    BrokenLinkAnalysisEvent.php:31

    Same as above, @var can be removed, comment can stay.

    AvailableActionsForExtensionEvent.php:27

    The @var string[] is actually needed, because it tells us, that the array is an array of strings. phpstan will complain about that at level 6, when we get there.

    PasswordChangeEvent.php:30

    This should probably be initialised with = null or getErrorMessage() could result in "access of uninitialised property".
  4. Chris Müller commented on patch set 1 02/12/22, 21:01

    SystemInformationToolbarCollectorEvent.php:30

    Use constructor property promotion with readonly (and at the other events where it is appropriate).
  5. Torben Hansen rebased onto patch set 2 02/13/22, 14:27

  6. core-ci voted on patch set 2 V +1 02/13/22, 14:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23481

  7. Torben Hansen uploaded patch set 3 02/13/22, 18:57

  8. Torben Hansen commented on patch set 2 02/13/22, 18:58

    SystemInformationToolbarCollectorEvent.php:30 Reply

    There are a lot of places for all PSR-14 events where constructor property promotion can be used. I changes the whole patch set to introduce constructor property promotion where appropriate.

    AfterPageColumnsSelectedForLocalizationEvent.php:34 Reply

    Done

    AlterTableDefinitionStatementsEvent.php:27 Reply

    Done

    BrokenLinkAnalysisEvent.php:31 Reply

    Done

    AvailableActionsForExtensionEvent.php:27 Reply

    Done

    PasswordChangeEvent.php:30 Reply

    Done
  9. core-ci voted on patch set 3 V +1 02/13/22, 19:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23482

  10. Benni Mack voted on patch set 3 CR +1 02/14/22, 07:37

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

    GeneratePublicUrlForResourceEvent.php:32

    private ?string $publicUrl = null; and empty __construct().

    AvailableActionsForExtensionEvent.php:35

    no property promotion here?

    PasswordChangeEvent.php:37

    no property promotion here?

    ModifyHrefLangTagsEvent.php:30

    readonly

    RenderAdditionalContentToRecordListEvent.php:32

    readonly

    RetrievedPreviewUrlEvent.php:36

    readonly

    RetrievedPreviewUrlEvent.php:37

    readonly

    RetrievedPreviewUrlEvent.php:39

    readonly
  12. Torben Hansen uploaded patch set 4 02/14/22, 10:16

  13. Torben Hansen commented on patch set 3 02/14/22, 10:16

    GeneratePublicUrlForResourceEvent.php:32 Reply

    Done

    AvailableActionsForExtensionEvent.php:35 Reply

    Done

    PasswordChangeEvent.php:37 Reply

    Done

    ModifyHrefLangTagsEvent.php:30 Reply

    Done

    RenderAdditionalContentToRecordListEvent.php:32 Reply

    Done

    RetrievedPreviewUrlEvent.php:36 Reply

    Done

    RetrievedPreviewUrlEvent.php:37 Reply

    Done

    RetrievedPreviewUrlEvent.php:39 Reply

    Done
  14. core-ci voted on patch set 4 V +1 02/14/22, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23499

  15. Christian Kuhn voted on patch set 4 V +1 CR +1 02/14/22, 12:02

  16. Benni Mack voted on patch set 4 V +2 CR +2 02/14/22, 12:10

  17. Benni Mack merged patch set 5 02/14/22, 12:10