Review main Merged

81075[TASK] Use proper File objects in FileProcessingService

Benni Mack CR +2 V +2 Normal +68 −106 updated 09/19/23, 16:02

Commit message

FileProcessingService and its surrounding code
within File / FileReference / ResourceStorage and
ProcessedFileRepository was hinted to use "FileInterface"
which is technically wrong, and - if used - throws
a PHP 8 warning because the ProcessedFileRepository
checks for the "uid" which is not present in a FileInterface
(only for FileReferences, File and ProcessedFile objects).

Since it is technically not possible to process a processed
file due to the DB relations, this code is now
using the correct type hints to avoid PHP errors.

In addition, the FileProcessingService is now made DI-aware,
so it can injected all necessary services.

As this is part of a series to clean up types within
FAL in v13, the PHP method signature changes will
be documented in a separate commit.

Review

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

Issues 2

Files 7

Review log 2127

Show 12 earlier messages
  1. Benni Mack uploaded patch set 1 09/18/23, 20:38

  2. core-ci voted on patch set 1 V -1 09/18/23, 20:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46712

  1. Benni Mack uploaded patch set 2 V -1 09/18/23, 21:02

  2. core-ci voted on patch set 2 V -1 09/18/23, 21:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46716

  3. Benni Mack uploaded patch set 3 V -1 09/18/23, 22:31

  4. core-ci voted on patch set 3 V -1 09/18/23, 22:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46724

  5. Benni Mack uploaded patch set 4 V -1 09/19/23, 07:50

  6. core-ci voted on patch set 4 V +1 09/19/23, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46734

  7. Oliver Klee commented on patch set 4 CR -1 09/19/23, 08:04

    ProcessedFileRepository.php:45

    I think we need to remove/deprecate this property. Otherwise, `createNewProcessedFileObject` will break with a type error if anything else than `ProcessedFile::class` (or a subclass) is used here.
  8. Oliver Klee commented on patch set 4 09/19/23, 08:19

    File.php:239

    We can drop this annotation now that we have the type declaration.

    ResourceStorage.php:1384

    We can drop this annotation now that we have the type declaration.
  9. Benni Mack commented on patch set 4 09/19/23, 08:19

    ProcessedFileRepository.php:45 Reply

    the whole logic of $objectType is not really useful in this repository. I suggest to remove the dependency to the AbstractRepository and build the ProcessedFileRepository standalone, however, I'd like to this is as a separate change.
  10. Benni Mack uploaded patch set 5 CR -1 V +1 09/19/23, 08:48

  11. Oliver Klee commented on patch set 5 09/19/23, 08:57

    ProcessedFileRepository.php:45 Reply

    Then at least we should update the comment here stating that this needs to be `ProcessedFile` or a subclass to avoid a type error.
  12. core-ci voted on patch set 5 V +1 09/19/23, 08:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46741

  13. Oliver Klee commented on patch set 5 09/19/23, 09:06

    File.php:239 Reply

    Done

    ResourceStorage.php:1384 Reply

    Done
  14. Benni Mack commented on patch set 5 09/19/23, 09:20

    ProcessedFileRepository.php:45 Reply

  15. Benni Mack commented on patch set 5 CR -2 09/19/23, 11:18

    waiting for the repository changes to be merged first
  16. Benni Mack uploaded patch set 6 V +1 09/19/23, 12:45

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR is:MIN")
  17. Benni Mack voted on patch set 6 CR 0 09/19/23, 12:45

  18. Benni Mack commented on patch set 6 09/19/23, 12:50

    ProcessedFileRepository.php:45 Reply

    Done
  19. core-ci voted on patch set 6 V +1 09/19/23, 12:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46777

  20. Oliver Klee voted on patch set 6 V +1 09/19/23, 14:15

  21. Stefan Bürk voted on patch set 6 V +1 CR +1 09/19/23, 15:47

  22. Oliver Klee voted on patch set 6 CR +1 09/19/23, 15:49

  23. Benni Mack voted on patch set 6 V +2 CR +2 09/19/23, 16:02

  24. Benni Mack merged patch set 7 09/19/23, 16:02

  25. Benni Mack commented on patch set 7 09/19/23, 16:02

    thank you