Skip to content
Commit 090f1874 authored by Oliver Klee's avatar Oliver Klee Committed by Christian Kuhn
Browse files

[BUGFIX] Fix some incorrect usages of Prophecy

With the following changes, we can get rid of a whole bunch
of warnings from the PHPStan baseline:

1. Now that we are using the Prophecy plugin for PHPStan,
   we don't need type annotations for prophecies anymore.
2. Prophecies are not instances of the prophesized classes.
   So we need to fix/remove type annotations that incorrectly
   state this, and also move accesses on properties from the
   prophecies to the revelations.
3. Revelations are not instances of ObjectProphecy. They
   implement ProphecySubjectInterface, but that usually is
   of no relevance to our test classes. So we can simplify
   the type annotations and usually convert those to native
   type annotations.
4. Have PHPStan ignore false positive related to class aliasing
   (that probably is outside of what PHPStan can do).
5. Drop extraneous arguments to Argument::any().

Resolves: #96713
Releases: main, 11.5
Change-Id: Icfe3ddef89c6bd6edf331c103211ac2ac18f2ef7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73257


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 409a2463
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment