[CLEANUP] Fix faulty type hint in install tool 05/47505/3
authorHelmut Hummel <info@helhum.io>
Tue, 5 Apr 2016 04:31:39 +0000 (06:31 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 5 Apr 2016 09:20:22 +0000 (11:20 +0200)
The DefaultFactory::getStructure method obviously has a wrong
type hint annotated. Besides that, the type checks inside the method
are obsolete, as the types can never change after instantiation.

Releases: master
Resolves: #75401
Change-Id: Id576310aa2b59d715eea520f67d54bc912be434d
Reviewed-on: https://review.typo3.org/47505
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/Controller/Action/Tool/FolderStructure.php
typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php

index fd584df..7f1d0c0 100644 (file)
@@ -31,7 +31,6 @@ class FolderStructure extends Action\AbstractAction
     {
         /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
         $folderStructureFactory = GeneralUtility::makeInstance(\TYPO3\CMS\Install\FolderStructure\DefaultFactory::class);
-        /** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
         $structureFacade = $folderStructureFactory->getStructure();
 
         $fixedStatusObjects = array();
index 9f06bde..46d2be2 100644 (file)
@@ -24,25 +24,12 @@ class DefaultFactory
     /**
      * Get default structure object hierarchy
      *
-     * @throws Exception
-     * @return RootNode
+     * @return StructureFacadeInterface
      */
     public function getStructure()
     {
         $rootNode = new RootNode($this->getDefaultStructureDefinition(), null);
-        if (!($rootNode instanceof RootNodeInterface)) {
-            throw new Exception(
-                'Root node must implement RootNodeInterface',
-                1366139176
-            );
-        }
         $structureFacade = new StructureFacade($rootNode);
-        if (!($structureFacade instanceof StructureFacadeInterface)) {
-            throw new Exception(
-                'Structure facade must implement StructureFacadeInterface',
-                1366535827
-            );
-        }
         return $structureFacade;
     }