Breaking: #97210 - Types added to method signatures or class properties

See Issue #97210

Description

The following PHP classes have had parameter and return types added to their method signatures. The types are consistent with existing docblock-documented type expectations and existing behavior.

  • \TYPO3\CMS\Core\Utility\ArrayUtility
  • \TYPO3\CMS\Core\Utility\ClassNamingUtility
  • \TYPO3\CMS\Core\Utility\CsvUtility
  • \TYPO3\CMS\Core\Utility\CommandUtility
  • \TYPO3\CMS\Core\Utility\DebugUtility
  • \TYPO3\CMS\Core\Utility\DiffUtility
  • \TYPO3\CMS\Core\Utility\ExtensionManagementUtility
  • \TYPO3\CMS\Core\Utility\MailUtility
  • \TYPO3\CMS\Core\Utility\MathUtility
  • \TYPO3\CMS\Core\Utility\PathUtility
  • \TYPO3\CMS\Core\Utility\RootlineUtility
  • \TYPO3\CMS\Core\Utility\StringUtility
  • \TYPO3\CMS\Core\Utility\VersionNumberUtility

The following PHP classes have added public class property types:

  • \TYPO3\CMS\Core\Utility\DiffUtility

Impact

Calling any of these methods with incompatible types now throws a \TypeError, especially if the calling code is within declare(strict_types=1); 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(strict_types=1);, 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.