Breaking: #97210 - Types added to method signatures or class properties
See forge#97210
Description
The following PHP classes have had parameter and return types added to some or all of their method signatures. The types are consistent with existing docblock-documented type expectations and existing behavior.
\TYPO3\
CMS\ Adminpanel\ Module Api\ Module Data Storage Collection \TYPO3\
CMS\ Backend\ Tree\ Sorted Tree Node Collection \TYPO3\
CMS\ Backend\ Tree\ Tree Node Collection \TYPO3\
CMS\ Core\ Collection\ Abstract Record Collection \TYPO3\
CMS\ Core\ Link Handling\ File Link Handler \TYPO3\
CMS\ Core\ Log\ Log Record \TYPO3\
CMS\ Core\ Messaging\ Flash Message Queue \TYPO3\
CMS\ Core\ Tree\ Table Configuration\ Database Tree Data Provider \TYPO3\
CMS\ Core\ Resource\ Collection\ Abstract File Collection \TYPO3\
CMS\ Core\ Resource\ Meta Data Aspect \TYPO3\
CMS\ Core\ Resource\ Search\ Result\ Empty File Search Result \TYPO3\
CMS\ Core\ Routing\ Site Route Result \TYPO3\
CMS\ Core\ Utility\ Array Utility \TYPO3\
CMS\ Core\ Utility\ Class Naming Utility \TYPO3\
CMS\ Core\ Utility\ Csv Utility \TYPO3\
CMS\ Core\ Utility\ Command Utility \TYPO3\
CMS\ Core\ Utility\ Debug Utility \TYPO3\
CMS\ Core\ Utility\ Diff Utility \TYPO3\
CMS\ Core\ Utility\ Extension Management Utility \TYPO3\
CMS\ Core\ Utility\ General Utility \TYPO3\
CMS\ Core\ Utility\ Mail Utility \TYPO3\
CMS\ Core\ Utility\ Math Utility \TYPO3\
CMS\ Core\ Utility\ Path Utility \TYPO3\
CMS\ Core\ Utility\ Rootline Utility \TYPO3\
CMS\ Core\ Utility\ String Utility \TYPO3\
CMS\ Core\ Utility\ Version Number Utility \TYPO3\
CMS\ Extbase\ Mvc\ Controller\ Arguments \TYPO3\
CMS\ Extbase\ Persistence\ Generic\ Lazy Object Storage \TYPO3\
CMS\ Extbase\ Persistence\ Generic\ Lazy Loading Proxy \TYPO3\
CMS\ Extbase\ Persistence\ Object Storage \TYPO3\
CMS\ Extbase\ Persistence\ Query Result
The following PHP classes have added public class property types:
\TYPO3\
CMS\ Core\ Utility\ Diff Utility
Impact
Calling any of these methods with incompatible types now throws a
\Type
,
especially if the calling code is within
declare
context.
Before the result of such method calls was undefined or inconsistent.
Affected Installations
Code routines that are passing an invalid type will need to ensure they pass a correct type.
If a code file is running with
declare
, that includes, for instance,
passing a numeric string to a method that expects an int or float. Those will need to be
properly cast before being passed.
The extension scanner will not find affected extensions.
Migration
Any code that is already passing the expected type to these methods will be unaffected. Code that is passing an incorrect type will need to pass the correct type, possibly including an explicit cast.