Review main Merged

57341[TASK] Reduce logic in render methods of YouTube and Vimeo Renderer

Daniel Goerz CR +2 V +2 Normal +126 −38 updated 06/30/18, 06:27

Commit message

This patch moves the logic from the render method of the
YouTube and Vimeo Renderer to dedicated methods to keep
the render methods themselves as short, clean and simple as
possible.

Also $options is initialized as an empty array as stated
in the interface.

Functionality, Output and Behavior stay unchanged.

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Frans Saris +1
    • Helmut Hummel +1
  • Verified V +2
    • Stefan Neufeind +2
    • Frans Saris +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 2129

Show 24 earlier messages
  1. Daniel Goerz uploaded patch set 1 06/23/18, 12:50

  2. TYPO3com voted on patch set 1 V -1 06/23/18, 12:50 Completed build in 07s on Sat, 23 Jun, 02:50 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24760

  3. Daniel Goerz uploaded patch set 2 06/23/18, 12:53

  4. TYPO3com voted on patch set 2 V -1 06/23/18, 13:01 Completed build in 08m 10s on Sat, 23 Jun, 03:01 PM Test Summary: 9 of 32971 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24761

  1. Daniel Goerz uploaded patch set 3 06/23/18, 13:11

  2. TYPO3com voted on patch set 3 V -1 06/23/18, 13:20 Completed build in 08m 47s on Sat, 23 Jun, 03:20 PM Test Summary: 3 of 32971 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24762

  3. Daniel Goerz uploaded patch set 4 06/23/18, 13:25

  4. TYPO3com voted on patch set 4 V -1 06/23/18, 13:35 Completed build in 10m 04s on Sat, 23 Jun, 03:35 PM Test Summary: 3 of 32971 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24765

  5. Daniel Goerz uploaded patch set 5 06/23/18, 13:47

  6. TYPO3com voted on patch set 5 V -1 06/23/18, 13:47 Completed build in 11s on Sat, 23 Jun, 03:47 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24769

  7. Daniel Goerz uploaded patch set 6 06/23/18, 13:50

  8. TYPO3com voted on patch set 6 V +1 06/23/18, 13:58 Completed build in 08m 10s on Sat, 23 Jun, 03:58 PM Test Summary: 32723 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24770

  9. Nicole Hummel commented on patch set 6 CR -1 06/23/18, 16:04

    VimeoRenderer.php:129

    Missing phpdoc annotation and type hinting.

    YouTubeRenderer.php:120

    doubled command? You could just use $options['controls'] = MathUtility::forceIntegerInRange($options['controls'] ?? 2, 0, 2); for the if/else block
  10. Daniel Goerz commented on patch set 6 06/23/18, 16:21

    VimeoRenderer.php:129 Reply

    Sure. That happens if you watch worldcup while preparing a patch... You can also see this in the fact that I needed 6 patchsets to get here :)

    YouTubeRenderer.php:120 Reply

    You mean instead of the if/else block? We need to check if it is set first or else we could end up accessing a nonexisting array key. This is "new" because $options is always an array now and not randomly null sometimes.
  11. Daniel Goerz uploaded patch set 7 06/23/18, 16:22

  12. Stefan Neufeind voted on patch set 7 CR +1 06/23/18, 16:29

  13. TYPO3com voted on patch set 7 V +1 06/23/18, 16:32 Completed build in 10m 13s on Sat, 23 Jun, 06:32 PM Test Summary: 32729 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24780

  14. Daniel Goerz uploaded patch set 8 06/23/18, 16:58

  15. Daniel Goerz commented on patch set 6 06/23/18, 16:59

    VimeoRenderer.php:129 Reply

    Done

    YouTubeRenderer.php:120 Reply

    Done
  16. TYPO3com voted on patch set 8 V +1 06/23/18, 17:06 Completed build in 08m 04s on Sat, 23 Jun, 07:06 PM Test Summary: 32729 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24782

  17. Frans Saris voted on patch set 8 V +1 CR +1 06/28/18, 17:10

  18. Helmut Hummel commented on patch set 8 06/28/18, 19:19

    my comments are not really related to this change, but maybe we take the chance to clean these up as well

    VimeoRenderer.php:99

    use htmlspecialchars($src) here

    VimeoRenderer.php:149

    use implode('&' here

    VimeoRenderer.php:177

    attributes should be collected with key value and GeneralUtility::implodeAttributes should be done in render method

    YouTubeRenderer.php:98

    same as vimeo renderer applies here
  19. Helmut Hummel voted on patch set 8 CR +1 06/29/18, 06:35

  20. Stefan Neufeind commented on patch set 8 V +2 CR +2 06/29/18, 06:42

    Discussed with Helmut we'll take care of proper escapings in a separate patch.
  21. Stefan Neufeind merged patch set 9 06/29/18, 06:42

  22. Frans Saris commented on patch set 9 06/29/18, 10:55

    I didn't notice the 8.7 in the release lines. Is it really needed to backport this refactoring?
  23. Stefan Neufeind commented on patch set 9 06/29/18, 11:08

    Maybe for easier backporting? For example we plan to do a patch on proper escaping etc. - which might be easier to do if the structure is similar. But of course it's doable without.
  24. Daniel Goerz commented on patch set 9 06/29/18, 11:53

    +1 for backporting, to ease further backporting of changes in these classes
  25. Frans Saris commented on patch set 9 06/30/18, 06:27

    Ok