Review main Merged

80120[TASK] Use strict types in ext:beuser domain models

Torben Hansen CR +2 V +2 Hard +147 −240 updated 07/25/23, 14:16

Commit message

This change introduces strict types for the domain models
`BackendUser` and `BackendUserGroup` in ext:beuser.

Both domain models now have a constructor, which calls `initializeObject()`
function to set the default value of ObjectStorage properties.

One unit test has been added for `BackendUser::isActive()` so it is
ensured that the function works as expected.

Finally, all properties in `BackendUserGroup` do now have a proper
default value.

Review

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

Issues 1

Files 4

Review log 1926

Show 1 earlier messages
  1. Torben Hansen uploaded patch set 1 07/23/23, 17:17

  1. Oliver Klee updated the commit message in patch set 2 07/23/23, 17:18

  2. core-ci voted on patch set 2 V +1 07/23/23, 17:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44442

  3. core-ci voted on patch set 1 V +1 07/23/23, 17:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44441

  4. Oliver Klee voted on patch set 2 V +1 07/23/23, 20:35

  5. Oliver Klee commented on patch set 2 07/23/23, 20:38

    I‘d suggest to have a pre-patch for removing the methods. That would allow us to follow the “only one kind of change per commit” rule. (Also, I wouldn’t expect the removal of methods if the title of the commit message is “Use strict types for …”
  6. Torben Hansen commented on patch set 2 07/24/23, 04:19

    Reply

    Agree. Done with https://review.typo3.org/c/Packages/TYPO3.CMS/+/80122. I'll set this patch to WIP until #101422 is merged
  7. Torben Hansen marked it work in progress 07/24/23, 04:19

  8. Torben Hansen uploaded patch set 3 V +1 07/24/23, 13:57

  9. Torben Hansen marked it ready for review 07/24/23, 13:58

  10. Oliver Klee commented on patch set 3 V +1 07/24/23, 14:09

    BackendUserTest.php:153

    I propose to split this into two testcases: - `isActiveForActiveConditionsFulfilledReturnsTrue` - `isActiveForActiveConditionsNotFulfilledReturnsFalse` (or with similar naming) This gets us away from a test that goes in the the "isActiveWorksCorrectly" direction. ;-)

    BackendUserTest.php:159

    … which also would allow us to use `assertTrue` and `assertFalse` here.
  11. core-ci voted on patch set 3 V +1 07/24/23, 14:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44472

  12. Torben Hansen uploaded patch set 4 V +1 07/24/23, 16:40

  13. Torben Hansen commented on patch set 3 07/24/23, 16:41

    BackendUserTest.php:153 Reply

    Yes, sounds good. Done

    BackendUserTest.php:159 Reply

    Done
  14. core-ci voted on patch set 4 V +1 07/24/23, 16:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44483

  15. Oliver Klee commented on patch set 4 07/24/23, 17:49

    BackendUserTest.php:133

    $disabled always is true. So we can remove it from the data provider and always set it to true here, allowing us to simplify the test and the DP even more.
  16. Torben Hansen uploaded patch set 5 V +1 07/25/23, 04:21

  17. Torben Hansen commented on patch set 4 07/25/23, 04:23

    BackendUserTest.php:133 Reply

    Done. Also removed `setIsDisabled()` in that test, since it the default value is used now.
  18. core-ci voted on patch set 5 V +1 07/25/23, 04:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44491

  19. Oliver Klee voted on patch set 5 V +1 CR +1 07/25/23, 07:44

  20. Torben Hansen uploaded patch set 6 CR +1 V +1 07/25/23, 13:34

  21. core-ci voted on patch set 6 V -1 07/25/23, 13:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44537

  22. core-ci voted on patch set 6 V +1 07/25/23, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44537

  23. Oliver Klee voted on patch set 6 V +1 CR +1 07/25/23, 14:15

  24. Christian Kuhn voted on patch set 6 V +2 CR +2 07/25/23, 14:16

  25. Christian Kuhn merged patch set 7 07/25/23, 14:16