[CLEANUP] Initialize variables and fix invalid function calls 25/51725/2
authorSascha Egerer <sascha@sascha-egerer.de>
Thu, 16 Feb 2017 21:55:08 +0000 (22:55 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 17 Feb 2017 10:54:49 +0000 (11:54 +0100)
* Initialize some uninitialized variables
* Fix invalid argument count on function calls
* Fix case typo in function call
* Fix some phpdoc issues

Resolves: #79865
Releases: master
Change-Id: I4e41940d849daa818735f75169e7cc686ee908c9
Reviewed-on: https://review.typo3.org/51725
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Configuration/TsConfigParser.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php
typo3/sysext/backend/Classes/Form/Container/OuterWrapContainer.php
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeDataProvider.php
typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php
typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php
typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php

index d4fcc99..3ca7f85 100644 (file)
@@ -34,6 +34,11 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
     public $id;
 
     /**
+     * @var string
+     */
+    public $type;
+
+    /**
      * Parses the passed TS-Config using conditions and caching
      *
      * @param string $TStext The TSConfig being parsed
index f22692a..ce98bde 100644 (file)
@@ -208,6 +208,11 @@ class EditDocumentController extends AbstractModule
     public $returnEditConf;
 
     /**
+     * @var string
+     */
+    public $localizationMode;
+
+    /**
      * Workspace used for the editing action.
      *
      * @var NULL|int
index 73e45c3..d2be4a1 100644 (file)
@@ -19,7 +19,6 @@ use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
@@ -81,7 +80,6 @@ class ReplaceFileController extends AbstractModule
     {
         parent::__construct();
         $GLOBALS['SOBE'] = $this;
-        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $this->init();
     }
 
index d684a70..53a958a 100644 (file)
@@ -304,7 +304,7 @@ class InlineControlContainer extends AbstractContainer
 
         $html .= '</div>';
 
-        $fieldWizardResult = $this->renderfieldWizard();
+        $fieldWizardResult = $this->renderFieldWizard();
         $fieldWizardHtml = $fieldWizardResult['html'];
         $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldWizardResult, false);
         $html .= $fieldWizardHtml;
index c80b755..d15fc61 100644 (file)
@@ -133,7 +133,7 @@ class OuterWrapContainer extends AbstractContainer
         $fieldInformationHtml = $fieldInformationResult['html'];
         $result = $this->mergeChildReturnIntoExistingResult($result, $fieldInformationResult, false);
 
-        $fieldWizardResult = $this->renderfieldWizard();
+        $fieldWizardResult = $this->renderFieldWizard();
         $fieldWizardHtml = $fieldWizardResult['html'];
         $result = $this->mergeChildReturnIntoExistingResult($result, $fieldWizardResult, false);
 
index 6ec79da..ef05e97 100644 (file)
@@ -96,6 +96,11 @@ class RecordHistory
     protected $pageAccessCache = [];
 
     /**
+     * @var string
+     */
+    protected $rollbackFields = '';
+
+    /**
      * @var IconFactory
      */
     protected $iconFactory;
@@ -284,7 +289,7 @@ class RecordHistory
         }
         // Return to normal operation
         $this->lastSyslogId = false;
-        $this->rollbackFields = false;
+        $this->rollbackFields = '';
         $this->createChangeLog();
         $this->view->assign('reloadPageFrame', $reloadPageFrame);
     }
index 8f78faf..e3c776a 100644 (file)
@@ -212,7 +212,7 @@ class ModuleLoader
      * fetches the conf.php file of a certain module, and also merges that with
      * some additional configuration
      *
-     * @param \string $moduleName the combined name of the module, can be "web", "web_info", or "tools_log"
+     * @param string $moduleName the combined name of the module, can be "web", "web_info", or "tools_log"
      * @return array an array with subarrays, named "configuration" (aka $MCONF), "labels" (previously known as $MLANG) and the stripped path
      */
     protected function getModuleSetupInformation($moduleName)
index 638de87..17890be 100644 (file)
@@ -72,7 +72,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTree
      * Fetches the next tree level
      *
      * @param int $nodeId
-     * @param stdClass $nodeData
+     * @param \stdClass $nodeData
      * @return array
      */
     public function getNextTreeLevel($nodeId, $nodeData)
@@ -92,7 +92,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTree
      * Returns a tree that only contains elements that match the given search string
      *
      * @param int $nodeId
-     * @param stdClass $nodeData
+     * @param \stdClass $nodeData
      * @param string $searchFilter
      * @return array
      */
index 82b39f5..a417585 100644 (file)
@@ -254,7 +254,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
      */
     public function canBeDisabledAndEnabled()
     {
-        return $this->canEdit($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
+        return $this->canEdit() && $GLOBALS['BE_USER']->checkLanguageAccess(0);
     }
 
     /**
@@ -265,7 +265,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
     public function canBeCut()
     {
         return
-            $this->canEdit($this->record)
+            $this->canEdit()
             && !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
             && $GLOBALS['BE_USER']->checkLanguageAccess(0)
         ;
@@ -278,7 +278,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
      */
     public function canBeEdited()
     {
-        return $this->canEdit($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
+        return $this->canEdit() && $GLOBALS['BE_USER']->checkLanguageAccess(0);
     }
 
     /**
@@ -302,7 +302,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
      */
     public function canCreateNewPages()
     {
-        return $this->canCreate($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
+        return $this->canCreate() && $GLOBALS['BE_USER']->checkLanguageAccess(0);
     }
 
     /**
@@ -313,7 +313,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
     public function canBeRemoved()
     {
         return
-            $this->canRemove($this->record)
+            $this->canRemove()
             && !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
             && $GLOBALS['BE_USER']->checkLanguageAccess(0)
         ;
@@ -327,7 +327,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
     public function canBePastedInto()
     {
         return
-            $this->canCreate($this->record)
+            $this->canCreate()
             && !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
             && $GLOBALS['BE_USER']->checkLanguageAccess(0)
         ;
@@ -341,7 +341,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
     public function canBePastedAfter()
     {
         return
-            $this->canCreate($this->record)
+            $this->canCreate()
             && !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
             && $GLOBALS['BE_USER']->checkLanguageAccess(0)
         ;
index 6027020..e04ee1e 100644 (file)
@@ -29,6 +29,7 @@ class TreeNodeCollection extends \ArrayObject
      */
     public function __construct(array $data = [])
     {
+        parent::__construct();
         if (!empty($data)) {
             $this->dataFromArray($data);
         }
index 760bbcb..885d5c8 100644 (file)
@@ -172,7 +172,7 @@ class PagePositionMap
                     // 1) It must be allowed to create a new page and 2) If there are subpages there is no need to render a subpage icon here - it'll be done over the subpages...
                     if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id) && !($prev_dat['invertedDepth'] > $pageTree->tree[$cc]['invertedDepth'])) {
                         end($lines);
-                        $lines[] = '<li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id, 1)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li>';
+                        $lines[] = '<li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li>';
                     }
                 }
                 // If going down
@@ -184,7 +184,7 @@ class PagePositionMap
                     if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) {
                         $prevPid = -$prev_dat['row']['uid'];
                         end($lines);
-                        $lines[] = '<li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $prev_dat['row']['pid'], 2)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li>';
+                        $lines[] = '<li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $prev_dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li>';
                     }
                     // Then set the current prevPid
                     $prevPid = -$prev_dat['row']['pid'];
@@ -201,7 +201,7 @@ class PagePositionMap
             }
             // print arrow on the same level
             if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
-                $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 3)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
+                $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
             }
             // The line with the icon and title:
             $toolTip = BackendUtility::getRecordToolTip($dat['row'], 'pages');
@@ -213,7 +213,7 @@ class PagePositionMap
         $prev_dat = end($pageTree->tree);
         if ($prev_dat['row']['uid'] == $id) {
             if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
-                $lines[] = '<ul class="list-tree" style="margin-left: 25px"><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id, 4)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
+                $lines[] = '<ul class="list-tree" style="margin-left: 25px"><li><span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span></li></ul>';
             }
         }
         for ($a = $latestInvDepth; $a <= $this->depth; $a++) {
@@ -223,7 +223,7 @@ class PagePositionMap
                 if ($latestInvDepth < $dat['invertedDepth']) {
                     $lines[] = '</ul>';
                 }
-                $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 5)) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
+                $lines[] = '<span class="text-nowrap"><a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'])) . '"><i class="t3-icon fa fa-long-arrow-left" title="' . $this->insertlabel() . '"></i></a></span>';
             }
         }