Review main Merged

77619[FEATURE] Provide a filter method for countries

Georg Ringer CR +2 V +2 Normal +158 −23 updated 02/04/23, 21:07

Commit message

Provide a filter method to create a list of countries with given
included and excluded countries.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 6

Review log 2736

Show 711 earlier messages
  1. Georg Ringer uploaded patch set 1 01/27/23, 08:04

  2. core-ci voted on patch set 1 V -1 01/27/23, 08:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36672

  3. Georg Ringer uploaded patch set 2 V -1 01/27/23, 08:23

  4. core-ci voted on patch set 2 V -1 01/27/23, 08:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36674

  5. Georg Ringer uploaded patch set 3 V -1 01/27/23, 08:41

  6. core-ci voted on patch set 3 V -1 01/27/23, 08:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36676

  7. Georg Ringer uploaded patch set 4 V -1 01/27/23, 09:58

  8. core-ci voted on patch set 4 V +1 01/27/23, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36679

  9. Georg Ringer commented on patch set 4 01/27/23, 10:20

    This change is ready for review.
  10. Oliver Klee commented on patch set 4 01/27/23, 10:41

    Let's be more specific with the types.

    CountryFilter.php:30

    @return string[]

    CountryFilter.php:35

    @param string[] $excludeCountries @return $this

    CountryFilter.php:41

    @return string[]

    CountryFilter.php:46

    @param string[] $onlyCountries @return $this

    CountryProvider.php:1774

    array<string, Country>
  11. Georg Ringer uploaded patch set 5 V +1 02/01/23, 06:00

  1. core-ci voted on patch set 5 V +1 02/01/23, 06:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36856

  2. Josef Glatz commented on patch set 5 CR -1 02/01/23, 06:26

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:73

    Newly added VH arguments of this patch are missing
  3. Georg Ringer uploaded patch set 6 CR -1 V +1 02/01/23, 07:10

  4. core-ci voted on patch set 6 V +1 02/01/23, 07:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36857

  5. Georg Ringer commented on patch set 6 02/01/23, 08:34

    CountryFilter.php:30 Reply

    Done

    CountryFilter.php:35 Reply

    Done

    CountryFilter.php:41 Reply

    Done

    CountryFilter.php:46 Reply

    Done

    CountryProvider.php:1774 Reply

    Done

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:73 Reply

    Done
  6. Oliver Klee voted on patch set 6 CR +1 02/01/23, 09:15

  7. Chris Müller commented on patch set 6 02/02/23, 12:25

    CountrySelectViewHelper.php:58

    What means "size"? The length of the field in px? The number of items displayed (when multiple set)? The number of countries displayed? As this is also used in the documentation, it should be clarified here.
  8. Stefan Bürk commented on patch set 6 02/02/23, 12:30

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:43

    I guess there a call is missing, something like ``` $filteredCountries = $countryProvider->getByFilter($filter); ```
  9. Stefan Bürk commented on patch set 6 02/02/23, 12:38

    CountryFilter.php:21

    Can we avoid the acronym here ? And eventually not calling it "DTO" at all ? ``` Simple object proving country list filter options ```

    CountryFilter.php:23

    Would go with final for this class. There is no need to extend this class.

    CountryFilter.php:26

    Can we add a constructor to the class, using CPP with privave readonly for the properties with empty array as defaults ? Personally I would favor more a immutable class design for this, but okay with the current if we add a constructor.

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:40

    There is no need to use GU::makeInstance here - the filter (option) class is a simple configuration object. simply new instantiating is enough. See class, should be final anyway, so also no need for "overriding" by container. Otherwise a proper "interface" should be implemented if really wanted. And with adding the stated constructor in the class thies could then be simpyfied provding the filters directly in the new call.
  10. Stefan Bürk commented on patch set 6 02/02/23, 12:40

    CountryProvider.php:1776

    Not happy with this method name ... maybe just simplyfy by using `filter` or at least `getFiltered()` .. `getByFilter()` is a duplication by the given argument and sounds kind of duplicated here ..
  11. Stefan Bürk commented on patch set 6 02/02/23, 12:49

    CountryFilter.php:26 Reply

    without `readonly` due the setter - or immutable design and "withX()" instead of setters ;)
  12. Georg Ringer uploaded patch set 7 CR +1 V +1 02/02/23, 12:54

  13. Georg Ringer commented on patch set 6 02/02/23, 12:54

    CountryFilter.php:21 Reply

    Done

    CountryFilter.php:23 Reply

    Done

    CountryFilter.php:26 Reply

    Ack

    CountryProvider.php:1776 Reply

    Done

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:40 Reply

    Done
  14. core-ci voted on patch set 7 V -1 02/02/23, 13:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36922

  15. Georg Ringer uploaded patch set 8 V -1 02/02/23, 13:14

  16. core-ci voted on patch set 8 V +1 02/02/23, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36925

  17. Simon Schaufelberger commented on patch set 8 02/03/23, 01:06

    CountryFilter.php:45

    shouldn't the return type be "self" instead?
  18. Oliver Klee commented on patch set 8 02/03/23, 10:28

    CountryFilter.php:45 Reply

    No: "$this" means "the instance on which the method was called" (i.e., a fluent interface), while "self" means "any instance of the same class of the object on which the method was called". So "$this" is a subset of "self". (PHPStan understands both.)
  19. Benni Mack uploaded patch set 9 V +1 02/03/23, 17:07

  20. Benni Mack commented on patch set 8 02/03/23, 17:07

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:43 Reply

    see the line below 😄

    CountrySelectViewHelper.php:58 Reply

    it's actually the same as in SelectViewHelper which I now also adapted.
  21. Benni Mack voted on patch set 9 CR +1 02/03/23, 17:08

  22. core-ci voted on patch set 9 V +1 02/03/23, 17:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37003

  23. Benni Mack voted on patch set 9 V +1 02/04/23, 21:01

  24. Stefan Bürk commented on patch set 9 V +2 CR +2 02/04/23, 21:07

    Feature-99618-ListOfCountriesInTheWorldAndTheirLocalizedNames.rst:43 Reply

    😊 there it is - how could I missed that 😂
  25. Stefan Bürk merged patch set 10 02/04/23, 21:07