[TASK] Deprecate TypeHandlingUtility::hex2bin 03/59603/4
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Fri, 1 Feb 2019 11:59:31 +0000 (12:59 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 23 Feb 2019 17:04:25 +0000 (18:04 +0100)
Method \TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin
has been deprecated. As of PHP 5.4, a native function hex2bin
exists, which should be used instead.

Releases: master
Resolves: #87613
Change-Id: I19cfade0584762148a611713412889bec4895200
Reviewed-on: https://review.typo3.org/c/59603
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-87613-DeprecateTYPO3CMSExtbaseUtilityTypeHandlingUtilityhex2bin.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Utility/TypeHandlingUtility.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-87613-DeprecateTYPO3CMSExtbaseUtilityTypeHandlingUtilityhex2bin.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-87613-DeprecateTYPO3CMSExtbaseUtilityTypeHandlingUtilityhex2bin.rst
new file mode 100644 (file)
index 0000000..d100fdb
--- /dev/null
@@ -0,0 +1,32 @@
+.. include:: ../../Includes.txt
+
+=======================================================================================
+Deprecation: #87613 - Deprecate \TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin
+=======================================================================================
+
+See :issue:`87613`
+
+Description
+===========
+
+:php:`\TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin` has been deprecated and will be removed in TYPO3 11.0.
+
+
+Impact
+======
+
+Calling :php:`\TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin` will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+All installations that call :php:`\TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin`
+
+
+Migration
+=========
+
+Use the native php function :php:`hex2bin` instead.
+
+.. index:: PHP-API, FullyScanned, ext:extbase
index 4b2c79a..afa4583 100644 (file)
@@ -158,9 +158,15 @@ class TypeHandlingUtility
      *
      * @param string $hexadecimalData A hex encoded string of data
      * @return string A binary string decoded from the input
+     * @deprecated
      */
     public static function hex2bin(string $hexadecimalData): string
     {
+        trigger_error(
+            'Method ' . __METHOD__ . ' will be removed in TYPO3 11.0, use native hex2bin instead.',
+            E_USER_DEPRECATED
+        );
+
         $binaryData = '';
         $length = strlen($hexadecimalData);
         for ($i = 0; $i < $length; $i += 2) {
index 5c98003..38bbcfb 100644 (file)
@@ -861,4 +861,11 @@ return [
             'Deprecation-87332-AvoidRuntimeReflectionCallsInObjectAccess.rst',
         ],
     ],
+    'TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::hex2bin' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-87613-DeprecateTYPO3CMSExtbaseUtilityTypeHandlingUtilityhex2bin.rst',
+        ],
+    ],
 ];