[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:core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
parent
409a2463
Please register or sign in to comment