From ab71719b963c57362c388b15cd358cd034659e6d Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Wed, 30 May 2018 11:44:32 +0200
Subject: [PATCH] [TASK] Change visibility of CharsetConverter init methods

Various CharsetConverter methods are there for initialization conversion,
which are marked as @private and are only used within the class.

The patch switches the method signatures from public to protected.

The following methods are affected:
- initCharset()
- initUnicodeData()
- initCaseFolding()
- initToASCII()

Resolves: #85116
Releases: master
Change-Id: I153123068cbfbf0baee729aab7dc0946913d5d7c
Reviewed-on: https://review.typo3.org/57088
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
---
 .../core/Classes/Charset/CharsetConverter.php | 12 ++++------
 ...fCharsetConverterInitializationMethods.rst | 24 +++++++++++++++++++
 2 files changed, 28 insertions(+), 8 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Important-85116-ChangedVisibilityOfCharsetConverterInitializationMethods.rst

diff --git a/typo3/sysext/core/Classes/Charset/CharsetConverter.php b/typo3/sysext/core/Classes/Charset/CharsetConverter.php
index 9249144e7414..043006e823c0 100644
--- a/typo3/sysext/core/Classes/Charset/CharsetConverter.php
+++ b/typo3/sysext/core/Classes/Charset/CharsetConverter.php
@@ -632,9 +632,8 @@ class CharsetConverter implements SingletonInterface
      * @param string $charset The charset to be initialized. Use lowercase charset always (the charset must match exactly with a filename in csconvtbl/ folder ([charset].tbl)
      * @return int Returns '1' if already loaded, '2' if the charset conversion table was found and parsed.
      * @throws UnknownCharsetException if no charset table was found
-     * @access private
      */
-    public function initCharset($charset)
+    protected function initCharset($charset)
     {
         // Only process if the charset is not yet loaded:
         if (!is_array($this->parsedCharsets[$charset])) {
@@ -698,9 +697,8 @@ class CharsetConverter implements SingletonInterface
      *
      * @param string $mode Mode ("case", "ascii", ...)
      * @return int Returns FALSE on error, a TRUE value on success: 1 table already loaded, 2, cached version, 3 table parsed (and cached).
-     * @access private
      */
-    public function initUnicodeData($mode = null)
+    protected function initUnicodeData($mode = null)
     {
         // Cache files
         $cacheFileCase = Environment::getVarPath() . '/charset/cscase_utf-8.tbl';
@@ -935,9 +933,8 @@ class CharsetConverter implements SingletonInterface
      *
      * @param string $charset Charset for which to initialize case folding.
      * @return int Returns FALSE on error, a TRUE value on success: 1 table already loaded, 2, cached version, 3 table parsed (and cached).
-     * @access private
      */
-    public function initCaseFolding($charset)
+    protected function initCaseFolding($charset)
     {
         // Only process if the case table is not yet loaded:
         if (is_array($this->caseFolding[$charset])) {
@@ -997,9 +994,8 @@ class CharsetConverter implements SingletonInterface
      *
      * @param string $charset Charset for which to initialize conversion.
      * @return int Returns FALSE on error, a TRUE value on success: 1 table already loaded, 2, cached version, 3 table parsed (and cached).
-     * @access private
      */
-    public function initToASCII($charset)
+    protected function initToASCII($charset)
     {
         // Only process if the case table is not yet loaded:
         if (is_array($this->toASCII[$charset])) {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-85116-ChangedVisibilityOfCharsetConverterInitializationMethods.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-85116-ChangedVisibilityOfCharsetConverterInitializationMethods.rst
new file mode 100644
index 000000000000..238fc9e1d4c4
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Important-85116-ChangedVisibilityOfCharsetConverterInitializationMethods.rst
@@ -0,0 +1,24 @@
+.. include:: ../../Includes.txt
+
+=================================================================================
+Important: #85116 - Changed visibility of CharsetConverter initialization methods
+=================================================================================
+
+See :issue:`85116`
+
+Description
+===========
+
+Initialization methods within TYPO3's :php:`CharsetConverter` class have changed visibility.
+
+The methods's purpose is to initialize conversion done with public API methods, and have previously
+been marked as private already.
+
+The following methods visibility have been changed from :php:`public` to :php:`protected`:
+
+- :php:`CharsetConverter::initCharset()`
+- :php:`CharsetConverter::initUnicodeData()`
+- :php:`CharsetConverter::initCaseFolding()`
+- :php:`CharsetConverter::initToASCII()`
+
+.. index:: PHP-API
\ No newline at end of file
-- 
GitLab