Review main Merged

73761[TASK] Add types to internal indexed_search code

Benni Mack CR +2 V +2 Normal +79 −143 updated 04/22/22, 17:48

Commit message

As a first part of restructuring indexed search,
this patch reduces some public methods to protected
if they are only used internally, and adds strict
types where possible to IndexSearchRepository
and IndexedSearchUtility.

Review

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

Issues 1

Files 2

Review log 3043

Show 1018 earlier messages
  1. Benni Mack uploaded patch set 1 03/02/22, 08:41

  2. core-ci voted on patch set 1 V -1 03/02/22, 08:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24437

  3. Benni Mack rebased onto patch set 2 03/02/22, 16:16

  4. core-ci voted on patch set 2 V -1 03/02/22, 16:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24472

  5. Benni Mack uploaded patch set 3 03/02/22, 20:22

  6. core-ci voted on patch set 3 V -1 03/02/22, 20:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24478

  7. Benni Mack uploaded patch set 4 03/02/22, 21:16

  8. core-ci voted on patch set 4 V -1 03/02/22, 21:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24480

  9. Benni Mack uploaded patch set 5 03/07/22, 20:59

  10. core-ci voted on patch set 5 V -1 03/07/22, 21:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24691

  11. Benni Mack rebased onto patch set 6 04/17/22, 20:25

  12. core-ci voted on patch set 6 V -1 04/17/22, 21:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26122

  13. core-ci commented on patch set 6 04/17/22, 22:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26122

  14. Stefan Bürk commented on patch set 6 CR -1 04/17/22, 22:16

    on it

    IndexSearchRepository.php:164

    needs (int) cast here

    IndexSearchRepository.php:166

    (bool) cast should be added here too
  15. Stefan Bürk uploaded patch set 7 04/17/22, 22:22

  16. Stefan Bürk commented on patch set 7 04/17/22, 22:22

    IndexSearchRepository.php:164 Reply

    Done

    IndexSearchRepository.php:166 Reply

    Done
  17. Stefan Bürk wrote 04/17/22, 22:30

    Removed reviewer Stefan Bürk.
  18. core-ci voted on patch set 7 V +1 04/17/22, 22:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26127

  1. Benni Mack updated the commit message in patch set 8 04/17/22, 22:47

  2. Benni Mack commented on patch set 8 04/17/22, 22:48

    Thanks, Stefan!
  3. core-ci voted on patch set 8 V +1 04/17/22, 22:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26129

  4. Oliver Klee commented on patch set 8 04/18/22, 09:05

    IndexSearchRepository.php:85

    This should be initialized with a value (e.g., false) to make sure the object is valid directly after contruction. (Relying on the initialize call seems a bit risky to me, and static code analysis also cannot know this.)

    IndexSearchRepository.php:180

    We can add the return types here.

    IndexSearchRepository.php:276

    We can add the return types here.

    IndexSearchRepository.php:301

    We can add the return types here.

    IndexSearchRepository.php:412

    We can add the return types here.

    IndexSearchRepository.php:626

    We can add the return types here.

    IndexSearchRepository.php:652

    We can add the return types here.

    IndexSearchRepository.php:670

    We can add the return types here.

    IndexSearchRepository.php:686

    We can add the return types here (and for all other methods).

    IndexedSearchUtility.php:40

    Please let's make the check more explicit (without implicit type casts): $tableList !== ''

    IndexedSearchUtility.php:154

    string $operator
  5. Stefan Bürk commented on patch set 8 CR -1 04/18/22, 09:07

    on it
  6. Stefan Bürk uploaded patch set 9 04/18/22, 10:44

  7. Stefan Bürk commented on patch set 8 CR 0 04/18/22, 10:44

    IndexSearchRepository.php:85 Reply

    Done

    IndexSearchRepository.php:180 Reply

    Done

    IndexSearchRepository.php:276 Reply

    Done

    IndexSearchRepository.php:301 Reply

    Done

    IndexSearchRepository.php:412 Reply

    Done

    IndexSearchRepository.php:626 Reply

    Done

    IndexSearchRepository.php:652 Reply

    Done

    IndexSearchRepository.php:670 Reply

    Done

    IndexSearchRepository.php:686 Reply

    Done

    IndexedSearchUtility.php:40 Reply

    Done

    IndexedSearchUtility.php:154 Reply

    Done
  8. Oliver Klee voted on patch set 9 CR +1 04/18/22, 11:03

  9. core-ci voted on patch set 9 V +1 04/18/22, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26139

  10. Stefan Bürk rebased onto patch set 10 04/20/22, 00:55

  11. core-ci voted on patch set 10 V +1 04/20/22, 01:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26212

  12. Stefan Bürk voted on patch set 10 V +1 CR +1 04/20/22, 01:17

  13. Oliver Klee voted on patch set 10 CR +1 04/20/22, 07:13

  14. Oli Bartsch commented on patch set 10 04/20/22, 08:43

    IndexSearchRepository.php:127

    Is this a leftover or intended?

    IndexSearchRepository.php:486

    Type cast is redundant

    IndexSearchRepository.php:573

    This should be casted to string now. $indexerObj->metaphone() currently returns "int|mixed".

    IndexSearchRepository.php:1187

    Could we get rid of this wrapper?

    IndexSearchRepository.php:1200

    Could we get rid of this wrapper?

    IndexSearchRepository.php:1255

    Return type missing?

    IndexedSearchUtility.php:74

    Do we need to typecast this or are we sure $val will always be a string?

    IndexedSearchUtility.php:99

    Return type missing?
  15. Stefan Bürk voted on patch set 10 V 0 CR 0 04/20/22, 08:45

  16. Oliver Klee voted on patch set 10 CR 0 04/20/22, 09:28

  17. Stefan Bürk uploaded patch set 11 04/22/22, 14:24

  18. Stefan Bürk commented on patch set 10 04/22/22, 14:25

    IndexSearchRepository.php:127 Reply

    Done

    IndexSearchRepository.php:486 Reply

    Done

    IndexSearchRepository.php:573 Reply

    Done

    IndexSearchRepository.php:1187 Reply

    Done

    IndexSearchRepository.php:1200 Reply

    Done

    IndexSearchRepository.php:1255 Reply

    Done

    IndexedSearchUtility.php:74 Reply

    Added two string cast in the split method, and adjusted the doctype. So it's ensured now. (and should have been before). Would this be fine with you ?

    IndexedSearchUtility.php:99 Reply

    Done
  19. core-ci voted on patch set 11 V +1 04/22/22, 14:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26305

  20. Oli Bartsch uploaded patch set 12 04/22/22, 17:24

  21. Oli Bartsch commented on patch set 12 V +1 CR +1 04/22/22, 17:24

    IndexedSearchUtility.php:74 Reply

    Done
  22. Stefan Bürk voted on patch set 12 V +1 CR +1 04/22/22, 17:25

  23. core-ci voted on patch set 12 V +1 04/22/22, 17:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26312

  24. Oli Bartsch voted on patch set 12 V +2 CR +2 04/22/22, 17:48

  25. Oli Bartsch merged patch set 13 04/22/22, 17:48