Review main Merged

63275[TASK] Mark TypeConverterException final

Alexander Schnitzler CR +2 V +2 Easy +1 −1 updated 02/22/20, 21:29

Commit message

Class \TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException
provides a factory method fromError to instantiate new instance of
itself. It's done via new static(...) which is unsafe if the class
is not final as the implementation cannot know if constructors of
sub classes have the same method signature like itself.

One solution to this issue is to make a class final, another is to
use new self() instead of new static(). In this case, the class is
made final as this is a very specific Exception already and unlikely
to be extended.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Stefan Froemken +1
    • Susi Moog +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 89

  1. Alexander Schnitzler uploaded patch set 1 02/17/20, 08:48

  2. Mathias Brodala commented on patch set 1 02/17/20, 08:49

    Another option would be adding a final constructor which would be less breaking.
  3. TYPO3com voted on patch set 1 V +1 02/17/20, 09:00 Completed build in 12m 49s on Mon, 17 Feb, 09:00 AM Test Summary: 71295 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-190

  4. Alexander Schnitzler commented on patch set 1 02/17/20, 09:03

    > Patch Set 1: > > Another option would be adding a final constructor which would be less breaking. I am open for different reasons, even simply ignoring this phpstan error for now.
  5. Stefan Froemken commented on patch set 1 CR +1 02/18/20, 21:15

    final is absolutely OK for me. Hey...it's an Exception. If you want to extend it, extend it from extbase class directly, create a copy or create your own Exception class. No problem for me.
  6. Susi Moog voted on patch set 1 V +1 CR +1 02/22/20, 18:33

  7. Daniel Goerz voted on patch set 1 V +2 CR +2 02/22/20, 19:53

  8. Daniel Goerz merged patch set 2 02/22/20, 19:53

  9. Daniel Goerz commented on patch set 2 02/22/20, 21:29

    The phpstan error exclusion rule for this class can be removed now