[!!!][TASK] Remove deprecated code in EditFileController 82/59282/3
authorAnja Leichsenring <anja.leichsenring@typo3.com>
Sat, 22 Dec 2018 17:18:01 +0000 (18:18 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 23 Dec 2018 14:02:49 +0000 (15:02 +0100)
Change-Id: I82b07824a592206110ff0f07dc97488dc5ce5c80
Resolves: #87278
Releases: master
Reviewed-on: https://review.typo3.org/59282
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/File/EditFileController.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php

index 1ea89a8..fc8d837 100644 (file)
@@ -21,11 +21,8 @@ use TYPO3\CMS\Backend\Form\FormResultCompiler;
 use TYPO3\CMS\Backend\Form\NodeFactory;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
-use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
-use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Http\RedirectResponse;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -35,7 +32,6 @@ use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 
 /**
@@ -44,27 +40,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
  */
 class EditFileController
 {
-    use PublicMethodDeprecationTrait;
-    use PublicPropertyDeprecationTrait;
-
-    /**
-     * @var array
-     */
-    private $deprecatedPublicMethods = [
-        'main' => 'Using EditFileController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-    ];
-
-    /**
-     * @var array
-     */
-    private $deprecatedPublicProperties = [
-        'origTarget' => 'Using $origTarget of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-        'target' => 'Using $target of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-        'returnUrl' => 'Using $returnUrl of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-        'content' => 'Using $content of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-        'title' => 'Using $title of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-        'doc' => 'Using $doc of class EditFileController from outside is discouraged, as this variable is only used for internal storage.',
-    ];
     /**
      * Module content accumulated.
      *
@@ -73,19 +48,6 @@ class EditFileController
     protected $content;
 
     /**
-     * @var string
-     */
-    protected $title;
-
-    /**
-     * Document template object
-     *
-     * @var DocumentTemplate
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, unused
-     */
-    protected $doc;
-
-    /**
      * Original input target
      *
      * @var string
@@ -126,18 +88,17 @@ class EditFileController
     public function __construct()
     {
         $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
-        // @deprecated since TYPO3 v9, will be moved out of __construct() in TYPO3 v10.0
-        $this->init($GLOBALS['TYPO3_REQUEST']);
     }
 
     /**
-     * Processes the request, currently everything is handled and put together via "main()"
+     * Processes the request, currently everything is handled and put together via "process()"
      *
      * @param ServerRequestInterface $request the current request
      * @return ResponseInterface the response with the content
      */
     public function mainAction(ServerRequestInterface $request): ResponseInterface
     {
+        $this->init($request);
         if ($response = $this->process()) {
             return $response;
         }
@@ -146,18 +107,6 @@ class EditFileController
     }
 
     /**
-     * Main function, rendering the actual content of the editing page
-     */
-    protected function main()
-    {
-        $response = $this->process();
-
-        if ($response instanceof RedirectResponse) {
-            HttpUtility::redirect($response->getHeaderLine('location'), $response->getStatusCode());
-        }
-    }
-
-    /**
      * Initialize script class
      *
      * @param ServerRequestInterface $request
@@ -190,15 +139,6 @@ class EditFileController
             );
         }
 
-        // Setting the title and the icon
-        $icon = $this->moduleTemplate->getIconFactory()->getIcon('apps-filetree-root', Icon::SIZE_SMALL)->render();
-        $this->title = $icon
-            . htmlspecialchars(
-                $this->fileObject->getStorage()->getName()
-            ) . ': ' . htmlspecialchars(
-                $this->fileObject->getIdentifier()
-            );
-
         // Setting template object
         $this->moduleTemplate->addJavaScriptCode(
             'FileEditBackToList',
index d8c36e4..edd8a6b 100644 (file)
@@ -531,6 +531,7 @@ The following class methods have changed visibility:
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm()` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->preInit()` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->processData()` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->main()` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\PageLayoutController->clearCache()` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\PageLayoutController->contentIsNotLockedForEditors()` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\PageLayoutController->getLocalizedPageTitle()` changed from public to protected
@@ -669,6 +670,12 @@ The following class properties have changed visibility:
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->viewId` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->viewId_addParams` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\EditDocumentController->viewUrl` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->origTarget` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->target` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->returnUrl` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->content` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->title` changed from public to protected
+* :php:`TYPO3\CMS\Backend\Controller\File\EditFileController->doc` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\FileSystemNavigationFrameController->content` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\FileSystemNavigationFrameController->foldertree` changed from public to protected
 * :php:`TYPO3\CMS\Backend\Controller\FileSystemNavigationFrameController->currentSubScript` changed from public to protected
index b884a94..2513ca2 100644 (file)
@@ -2219,6 +2219,7 @@ return [
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
             'Deprecation-84295-UseServerRequestInterfaceInFileEditFileController.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Backend\Controller\LoginController->makeInterfaceSelectorBox' => [
index f1fae0e..27659b2 100644 (file)
@@ -380,16 +380,19 @@ return [
     'TYPO3\CMS\Backend\Controller\File\EditFileController->origTarget' => [
         'restFiles' => [
             'Deprecation-84295-UseServerRequestInterfaceInFileEditFileController.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Backend\Controller\File\EditFileController->target' => [
         'restFiles' => [
             'Deprecation-84295-UseServerRequestInterfaceInFileEditFileController.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Backend\Controller\File\EditFileController->doc' => [
         'restFiles' => [
             'Deprecation-84295-UseServerRequestInterfaceInFileEditFileController.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Core\Charset\CharsetConverter->synonyms' => [