[TASK] Cleanup EXT:frontend
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / Menu / MenuContentObjectFactory.php
index 8f6bb40..8a98ca8 100644 (file)
@@ -14,14 +14,15 @@ namespace TYPO3\CMS\Frontend\ContentObject\Menu;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\SingletonInterface;
+
 /**
  * Factory for menu content objects. Allows overriding the default
  * types like 'GMENU' with an own implementation (only one possible)
  * and new types can be registered.
- *
- * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class MenuContentObjectFactory implements \TYPO3\CMS\Core\SingletonInterface {
+class MenuContentObjectFactory implements SingletonInterface {
 
        /**
         * Register of TypoScript keys to according render class
@@ -29,10 +30,10 @@ class MenuContentObjectFactory implements \TYPO3\CMS\Core\SingletonInterface {
         * @var array
         */
        protected $menuTypeToClassMapping = array(
-               'GMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\GraphicalMenuContentObject::class,
-               'TMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\TextMenuContentObject::class,
-               'IMGMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\ImageMenuContentObject::class,
-               'JSMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\JavaScriptMenuContentObject::class,
+               'GMENU' => GraphicalMenuContentObject::class,
+               'TMENU' => TextMenuContentObject::class,
+               'IMGMENU' => ImageMenuContentObject::class,
+               'JSMENU' => JavaScriptMenuContentObject::class,
        );
 
        /**
@@ -43,9 +44,9 @@ class MenuContentObjectFactory implements \TYPO3\CMS\Core\SingletonInterface {
         * @throws Exception\NoSuchMenuTypeException
         */
        public function getMenuObjectByType($type = '') {
-               $uppercasedClassname = strtoupper($type);
-               if (array_key_exists($uppercasedClassname, $this->menuTypeToClassMapping)) {
-                       $object = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($this->menuTypeToClassMapping[$uppercasedClassname]);
+               $upperCasedClassName = strtoupper($type);
+               if (array_key_exists($upperCasedClassName, $this->menuTypeToClassMapping)) {
+                       $object = GeneralUtility::makeInstance($this->menuTypeToClassMapping[$upperCasedClassName]);
                } else {
                        throw new Exception\NoSuchMenuTypeException(
                                'Menu type ' . (string)$type . ' has no implementing class.',