Review main Merged

69792[TASK] Improve exception messages in ImageService

Oli Bartsch CR +2 V +2 Easy +34 −10 updated 07/12/21, 17:00

Commit message

The Extbase ImageService contains a helper method
`getImage()`. This method tries to find an image in a
couple of different ways, depending on the given input
arguments.

To improve the usability, the exception messages are
now dedicated to their corresponding try. As a side
effect, the method is now also more readable as it
now uses guard clauses and also contains a couple
of code comments.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 911

  1. Oli Bartsch uploaded patch set 1 07/09/21, 12:09

  2. core-ci voted on patch set 1 V +1 07/09/21, 12:21 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13141

  3. Andreas Kienast commented on patch set 1 CR -1 07/09/21, 13:00

    ImageService.php:139

    IMO this is a change of behavior. Previously, the original resource was fetched via getOriginalResource() and then checked if it's either a File or FileReference, now we trust whatever getOriginalResource() returns.
  4. Oli Bartsch commented on patch set 1 07/09/21, 13:34

    ImageService.php:139 Reply

    ACK, thought FileReference is defined as return type. However it's only annotated in the PHPdoc. Good catch, will update.
  5. Oli Bartsch uploaded patch set 2 07/09/21, 14:05

  6. Oli Bartsch commented on patch set 2 07/09/21, 14:06

    ImageService.php:139 Reply

    Done
  7. core-ci voted on patch set 2 V +1 07/09/21, 14:15 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13151

  8. Jochen Roth voted on patch set 2 V +1 CR +1 07/12/21, 14:33

  9. Benni Mack voted on patch set 2 V +1 CR +1 07/12/21, 14:54

  10. Oli Bartsch voted on patch set 2 V +2 CR +2 07/12/21, 17:00

  11. Oli Bartsch merged patch set 3 07/12/21, 17:00