diff --git a/typo3/sysext/core/Classes/Utility/DebugUtility.php b/typo3/sysext/core/Classes/Utility/DebugUtility.php index 51182778fcdc69f71c14dbc424d525aae3bc71f7..4060a6503b24e727b34eb805e7d9bb9f5336d1c4 100644 --- a/typo3/sysext/core/Classes/Utility/DebugUtility.php +++ b/typo3/sysext/core/Classes/Utility/DebugUtility.php @@ -58,9 +58,11 @@ class DebugUtility /** * Opens a debug message inside a popup window + * @deprecated since v12, will be removed in v13. */ public static function debugInPopUpWindow(mixed $debugVariable, string $header = 'Debug', string $group = 'Debug'): void { + trigger_error('Method ' . __METHOD__ . ' has been deprecated in v12 and will be removed with v13.', E_USER_DEPRECATED); $debugString = self::renderDump($debugVariable, sprintf('%s (%s)', $header, $group)); $script = ' (function debug() { @@ -131,9 +133,11 @@ class DebugUtility * * @param array $rows Array of arrays with similar keys * @param string $header Table header + * @deprecated since v12, will be removed in v13. */ public static function debugRows(array $rows, string $header = ''): void { + trigger_error('Method ' . __METHOD__ . ' has been deprecated in v12 in favor of ' . __CLASS__ . '::debug and will be removed with v13.', E_USER_DEPRECATED); self::debug($rows, $header); } @@ -174,9 +178,11 @@ class DebugUtility * * @param mixed $array_in Array to print visually (in a table). * @see viewArray() + * @deprecated since v12, will be removed in v13. */ public static function printArray(mixed $array_in): void { + trigger_error('Method ' . __METHOD__ . ' has been deprecated in v12 in favor of ' . __CLASS__ . '::viewArray and will be removed with v13.', E_USER_DEPRECATED); echo self::renderDump($array_in); } diff --git a/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst b/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst new file mode 100644 index 0000000000000000000000000000000000000000..408b8f3f010d01a2f13cb9f2f3a39d738513aebf --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst @@ -0,0 +1,53 @@ +.. include:: /Includes.rst.txt + +.. _deprecation-100653-1681805677: + +============================================================== +Deprecation: #100653 - Deprecated some methods in DebugUtility +============================================================== + +See :issue:`100653` + +Description +=========== + +The following methods in :php:`TYPO3\CMS\Core\Utility\DebugUtility` have been +marked as deprecated: + +* :php:`debugInPopUpWindow()` +* :php:`debugRows()` +* :php:`printArray()` + +While :php:`debugRows()` and :php:`printArray()` duplicate already existing +methods, :php:`debugInPopUpWindow()` is discouraged to use as either external +debuggers, e.g. xdebug or :php:`TYPO3\CMS\Extbase\Utility\DebuggerUtility` may +be used instead. + + +Impact +====== + +Calling any of the aforementioned methods will trigger deprecation log entries. + + +Affected installations +====================== + +Instances using any of the aforementioned methods are affected. + +The extension scanner will find and report usages. + + +Migration +========= + +In case of :php:`debugRows()`, the identical method :php:`debug()` can be used. +The method :php:`printArray()` can be replaced with :php:`viewArray()`. However, +the former method directly outputs the contents, which is not the case with +:php:`viewArray()`. + +The method :php:`debugInPopUpWindow()` is deprecated without a direct +replacement, consider using an external debugger or +:php:`TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()` instead. + +.. index:: PHP-API, FullyScanned, ext:core diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php index 5807d5b323b2fc086d259f72ef5ea735999fcb12..6462347ae6b5bdd7037029464feb5028444af165 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php @@ -1506,4 +1506,25 @@ return [ 'Deprecation-100596-GeneralUtility_GET.rst', ], ], + 'TYPO3\CMS\Core\Utility\DebugUtility::debugRows' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 2, + 'restFiles' => [ + 'Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst', + ], + ], + 'TYPO3\CMS\Core\Utility\DebugUtility::printArray' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 1, + 'restFiles' => [ + 'Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst', + ], + ], + 'TYPO3\CMS\Core\Utility\DebugUtility::debugInPopUpWindow' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 3, + 'restFiles' => [ + 'Deprecation-100653-DeprecatedSomeMethodsInDebugUtility.rst', + ], + ], ];