[FOLLOWUP] Revamp EXT:recycler 46/36646/5
authorFrederic Gaus <gaus@flagbit.de>
Wed, 4 Feb 2015 10:17:28 +0000 (11:17 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 4 Feb 2015 14:08:21 +0000 (15:08 +0100)
Fix a few coding issues in new EXT:recycler

* Remove IDE warnings
* Correct phpDoc
* Remove an unused variable
* Introduce a int typecast of GP:id
* Replace spaces with tabs

Change-Id: I8eaadd51c29506958d7fa80c375ddf943dfbac2f
Resolves: #64844
Releases: master
Reviewed-on: http://review.typo3.org/36646
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php
typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php

index cc86785..fb8aacf 100644 (file)
@@ -62,6 +62,7 @@ class RecyclerAjaxController {
         */
        public function dispatch($params = array(), AjaxRequestHandler $ajaxObj = NULL) {
                $extPath = ExtensionManagementUtility::extPath('recycler');
+               /* @var $view StandaloneView */
                $view = GeneralUtility::makeInstance(StandaloneView::class);
                $view->setPartialRootPaths(array('default' => $extPath . 'Resources/Private/Partials'));
 
@@ -85,11 +86,10 @@ class RecyclerAjaxController {
                                $model->loadData($this->conf['startUid'], $this->conf['table'], $this->conf['depth'], $this->conf['start'] . ',' . $this->conf['limit'], $this->conf['filterTxt']);
                                $deletedRowsArray = $model->getDeletedRows();
 
-                               /* @var $model DeletedRecords */
                                $model = GeneralUtility::makeInstance(DeletedRecords::class);
                                $totalDeleted = $model->getTotalCount($this->conf['startUid'], $this->conf['table'], $this->conf['depth'], $this->conf['filter']);
 
-                               /* @var $view DeletedRecordsController */
+                               /* @var $controller DeletedRecordsController */
                                $controller = GeneralUtility::makeInstance(DeletedRecordsController::class);
                                $recordsArray = $controller->transform($deletedRowsArray, $totalDeleted);
 
index 13bd3a5..f8bd3e8 100644 (file)
@@ -51,13 +51,18 @@ class RecyclerModuleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionC
         */
        protected $recordsPageLimit = 50;
 
+       /**
+        * @var int
+        */
+       protected $id;
+
        /**
         * Initializes the Module
         *
         * @return void
         */
        public function initializeAction() {
-               $this->id = GeneralUtility::_GP('id');
+               $this->id = (int)GeneralUtility::_GP('id');
                $backendUser = $this->getBackendUser();
                $this->perms_clause = $backendUser->getPagePermsClause(1);
                $this->pageRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
@@ -89,11 +94,10 @@ class RecyclerModuleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionC
        public function indexAction() {
                // Integrate dynamic JavaScript such as configuration or lables:
                $jsConfiguration = $this->getJavaScriptConfiguration();
-        $this->getPageRenderer()->addInlineSettingArray('Recycler', $jsConfiguration);
+               $this->getPageRenderer()->addInlineSettingArray('Recycler', $jsConfiguration);
                $this->getPageRenderer()->addInlineLanguageLabelFile('EXT:recycler/Resources/Private/Language/locallang.xlf');
 
                $this->view->assign('title', $this->getLanguageService()->getLL('title'));
-               $this->view->assign('content', $this->content);
                $this->view->assign('allowDelete', $this->allowDelete);
        }
 
@@ -154,7 +158,7 @@ class RecyclerModuleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionC
        /**
         * Returns an instance of DocumentTemplate
         *
-        * @return TYPO3\CMS\Backend\Template\DocumentTemplate
+        * @return \TYPO3\CMS\Backend\Template\DocumentTemplate
         */
        protected function getDocumentTemplate() {
                return $GLOBALS['TBE_TEMPLATE'];