Review main Merged

73259[TASK] Use generics for ObjectProphecy class properties

Benjamin Franzke CR +2 V +2 Normal +78 −15 updated 02/03/22, 08:07

Commit message

With #96713 all type annotations on class properties
in tests have been reduced to ObjectProphecy only,
removing the information which class or interface
is mocked. This means that phpstan no longer
throws errors for valid cases but also ignored
invalid calls as the type effectively is considered
a mixed type.

The jangregor/phpstan-prophecy plugin defines ObjectProphecy
as a generic tag, allowing generics to be used and
resolved by PHPStan. Therefore the type annotations
on class properties or function results are now re-added
using generic syntax.

Review

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

Issues 2

Files 40

Show 20 more files

Review log 78

  1. Benjamin Franzke uploaded patch set 1 02/01/22, 15:55

  2. core-ci voted on patch set 1 V +1 02/01/22, 16:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22880

  3. Stefan Bürk commented on patch set 1 V +1 CR +1 02/01/22, 16:43

    Took a while, getting your point on the related patch. But now with this patch and testing, this makes absolutly sense. Sure, it won't help in IDE (PHPStorm), which is a pitty, but phpstan can it's job better. Thanks for your nailing and providing this patch, Benjamin !!
  4. Stefan Bürk commented on patch set 1 02/01/22, 16:51

    Reply

    can do*
  5. Benni Mack voted on patch set 1 V +1 CR +1 02/02/22, 10:45

  6. Oliver Klee voted on patch set 1 CR +1 02/02/22, 11:32

  7. Benjamin Franzke voted on patch set 1 V +2 CR +2 02/03/22, 08:04

  8. Benjamin Franzke merged patch set 2 02/03/22, 08:07