From 949e4de8bc37f718c248c3edd8403fa1ae0b2ac7 Mon Sep 17 00:00:00 2001
From: Markus Hoelzle <typo3@markus-hoelzle.de>
Date: Thu, 7 Sep 2017 22:33:36 +0200
Subject: [PATCH] [CLEANUP] Remove some unused variables and cleanup some code
 styles

Remove some unused variable and cleanup some PHP docs and some code styles

Resolves: #82364
Releases: master
Change-Id: I72f69a7c05514088bd318fed0e2c4ecc4710e183
Reviewed-on: https://review.typo3.org/53975
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Simon Praetorius <simon@praetorius.me>
Reviewed-by: Matthias Vogel <typo3@kanti.de>
Reviewed-by: Romain Canon <romain.hydrocanon@gmail.com>
Tested-by: Matthias Vogel <typo3@kanti.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
---
 .../sysext/core/Classes/DataHandling/DataHandler.php |  1 -
 .../sysext/core/Classes/Database/ConnectionPool.php  |  1 -
 .../core/Classes/Imaging/GraphicalFunctions.php      |  3 +--
 typo3/sysext/core/Classes/Imaging/IconRegistry.php   | 12 ------------
 .../sysext/core/Classes/Migrations/TcaMigration.php  |  1 -
 typo3/sysext/core/Classes/Utility/GeneralUtility.php |  1 -
 .../Functional/Resource/ResourceStorageTest.php      |  1 -
 .../Classes/Domain/Factory/AbstractFormFactory.php   |  1 -
 .../Classes/Domain/Renderer/FluidFormRenderer.php    |  1 -
 .../form/Classes/Domain/Runtime/FormRuntime.php      |  2 +-
 .../form/Classes/Hooks/FormElementsOnSubmitHooks.php |  1 +
 typo3/sysext/form/Classes/Mvc/ProcessingRule.php     |  1 -
 .../form/Classes/ViewHelpers/FormViewHelper.php      |  1 -
 .../ViewHelpers/RenderAllFormValuesViewHelper.php    |  1 -
 14 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
index a3277ffe7a8d..4367d5a2cca1 100644
--- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php
+++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
@@ -3062,7 +3062,6 @@ class DataHandler
                 }
 
                 if ($DSelements[$key]['section']) {
-                    $newIndexCounter = 0;
                     foreach ($dataValues[$key]['el'] as $ik => $el) {
                         if (!is_array($el)) {
                             continue;
diff --git a/typo3/sysext/core/Classes/Database/ConnectionPool.php b/typo3/sysext/core/Classes/Database/ConnectionPool.php
index 50be13d7f24c..f32ba7022cc3 100644
--- a/typo3/sysext/core/Classes/Database/ConnectionPool.php
+++ b/typo3/sysext/core/Classes/Database/ConnectionPool.php
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Core\Database;
  * The TYPO3 project - inspiring people to share!
  */
 
-use Doctrine\DBAL\Configuration;
 use Doctrine\DBAL\DriverManager;
 use Doctrine\DBAL\Events;
 use Doctrine\DBAL\Types\Type;
diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
index 253646b99feb..aff1a4ea436b 100644
--- a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
+++ b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
@@ -2710,8 +2710,7 @@ class GraphicalFunctions
                     if ($this->setup['quality']) {
                         $quality = MathUtility::forceIntegerInRange($this->setup['quality'], 10, 100);
                     }
-                    if ($this->ImageWrite($this->im, $file, $quality)) {
-                    }
+                    $this->ImageWrite($this->im, $file, $quality);
                     break;
             }
         }
diff --git a/typo3/sysext/core/Classes/Imaging/IconRegistry.php b/typo3/sysext/core/Classes/Imaging/IconRegistry.php
index d3d4a8abd1dc..f9a11bcc0756 100644
--- a/typo3/sysext/core/Classes/Imaging/IconRegistry.php
+++ b/typo3/sysext/core/Classes/Imaging/IconRegistry.php
@@ -2368,12 +2368,6 @@ class IconRegistry implements SingletonInterface
                 'name' => 'plug'
             ]
         ],
-        'module-help' => [
-            'provider' => FontawesomeIconProvider::class,
-            'options' => [
-                'name' => 'question-circle'
-            ]
-        ],
         'module-about' => [
             'provider' => SvgIconProvider::class,
             'options' => [
@@ -2640,12 +2634,6 @@ class IconRegistry implements SingletonInterface
                 'source' => 'EXT:core/Resources/Public/Icons/T3Icons/overlay/overlay-hidden.svg'
             ]
         ],
-        'overlay-endtime' => [
-            'provider' => SvgIconProvider::class,
-            'options' => [
-                'source' => 'EXT:core/Resources/Public/Icons/T3Icons/overlay/overlay-endtime.svg'
-            ]
-        ],
         'overlay-includes-subpages' => [
             'provider' => SvgIconProvider::class,
             'options' => [
diff --git a/typo3/sysext/core/Classes/Migrations/TcaMigration.php b/typo3/sysext/core/Classes/Migrations/TcaMigration.php
index e5def1ff9252..ed5c6fde71d6 100644
--- a/typo3/sysext/core/Classes/Migrations/TcaMigration.php
+++ b/typo3/sysext/core/Classes/Migrations/TcaMigration.php
@@ -206,7 +206,6 @@ class TcaMigration
                         'paletteName' => isset($fieldArray[2]) ? $fieldArray[2] : null,
                         'fieldExtra' => isset($fieldArray[3]) ? $fieldArray[3] : null,
                     ];
-                    $fieldName = $fieldArray['fieldName'];
                     if (!empty($fieldArray['fieldExtra'])) {
                         // Move fieldExtra "specConf" to columnsOverrides "defaultExtras"
                         if (!isset($newTca[$table]['types'][$typeName]['columnsOverrides'])) {
diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
index 7ad9352760ae..6e36761836c0 100644
--- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php
+++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
@@ -706,7 +706,6 @@ class GeneralUtility
     {
         $hashAlgorithm = 'sha1';
         $hashBlocksize = 64;
-        $hmac = '';
         $secret = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . $additionalSecret;
         if (extension_loaded('hash') && function_exists('hash_hmac') && function_exists('hash_algos') && in_array($hashAlgorithm, hash_algos())) {
             $hmac = hash_hmac($hashAlgorithm, $input, $secret);
diff --git a/typo3/sysext/core/Tests/Functional/Resource/ResourceStorageTest.php b/typo3/sysext/core/Tests/Functional/Resource/ResourceStorageTest.php
index 183df4fa3409..cafef0323928 100644
--- a/typo3/sysext/core/Tests/Functional/Resource/ResourceStorageTest.php
+++ b/typo3/sysext/core/Tests/Functional/Resource/ResourceStorageTest.php
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Core\Tests\Functional\Resource;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\FolderInterface;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
diff --git a/typo3/sysext/form/Classes/Domain/Factory/AbstractFormFactory.php b/typo3/sysext/form/Classes/Domain/Factory/AbstractFormFactory.php
index 809d2bd3e080..1a2169a4635d 100644
--- a/typo3/sysext/form/Classes/Domain/Factory/AbstractFormFactory.php
+++ b/typo3/sysext/form/Classes/Domain/Factory/AbstractFormFactory.php
@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Form\Domain\Factory;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Form\Domain\Model\FormDefinition;
 
 /**
diff --git a/typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php b/typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php
index 0f0bd0aca260..b5431569b9cc 100644
--- a/typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php
+++ b/typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php
@@ -21,7 +21,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\View\TemplateView;
 use TYPO3\CMS\Form\Domain\Exception\RenderingException;
-use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3\CMS\Form\ViewHelpers\RenderRenderableViewHelper;
 
 /**
diff --git a/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php b/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
index 5aaa7e8d0af8..fddd525f2368 100644
--- a/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
+++ b/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
@@ -333,7 +333,7 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
 
     /**
      * @param Page $page
-     * return null|string
+     * @return null|string
      */
     protected function getHoneypotNameFromSession(Page $page)
     {
diff --git a/typo3/sysext/form/Classes/Hooks/FormElementsOnSubmitHooks.php b/typo3/sysext/form/Classes/Hooks/FormElementsOnSubmitHooks.php
index 4df3b1ad9e6f..bacae1884189 100644
--- a/typo3/sysext/form/Classes/Hooks/FormElementsOnSubmitHooks.php
+++ b/typo3/sysext/form/Classes/Hooks/FormElementsOnSubmitHooks.php
@@ -35,6 +35,7 @@ class FormElementsOnSubmitHooks
      * @param RenderableInterface $renderable
      * @param mixed $elementValue submitted value of the element *before post processing*
      * @param array $requestArguments submitted raw request values
+     * @return mixed
      * @see FormRuntime::mapAndValidate()
      * @internal
      */
diff --git a/typo3/sysext/form/Classes/Mvc/ProcessingRule.php b/typo3/sysext/form/Classes/Mvc/ProcessingRule.php
index 69f7968ce510..bd41f1411d42 100644
--- a/typo3/sysext/form/Classes/Mvc/ProcessingRule.php
+++ b/typo3/sysext/form/Classes/Mvc/ProcessingRule.php
@@ -19,7 +19,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Error\Result;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\Property\PropertyMappingConfiguration;
-use TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator;
 use TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface;
 
 /**
diff --git a/typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php b/typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php
index 1d7fb121b579..fbff0d23f5ae 100644
--- a/typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php
+++ b/typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Form\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Extbase\Mvc\Web\Request;
 use TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper as FluidFormViewHelper;
 use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;
 
diff --git a/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php b/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
index 518c341d9664..61cfce738d80 100644
--- a/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
+++ b/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
@@ -23,7 +23,6 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface;
 use TYPO3\CMS\Form\Domain\Model\Renderable\CompositeRenderableInterface;
 use TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface;
-use TYPO3\CMS\Form\Domain\Runtime\FormRuntime;
 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
 
-- 
GitLab