[CLEANUP] Fix faulty type hint in install tool
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Controller / Action / Tool / FolderStructure.php
1 <?php
2 namespace TYPO3\CMS\Install\Controller\Action\Tool;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 use TYPO3\CMS\Install\Controller\Action;
19
20 /**
21 * Handle folder structure
22 */
23 class FolderStructure extends Action\AbstractAction
24 {
25 /**
26 * Executes the tool
27 *
28 * @return string Rendered content
29 */
30 protected function executeAction()
31 {
32 /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
33 $folderStructureFactory = GeneralUtility::makeInstance(\TYPO3\CMS\Install\FolderStructure\DefaultFactory::class);
34 $structureFacade = $folderStructureFactory->getStructure();
35
36 $fixedStatusObjects = array();
37 if (isset($this->postValues['set']['fix'])) {
38 $fixedStatusObjects = $structureFacade->fix();
39 }
40
41 $statusObjects = $structureFacade->getStatus();
42 /** @var $statusUtility \TYPO3\CMS\Install\Status\StatusUtility */
43 $statusUtility = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\StatusUtility::class);
44
45 $errorStatus = array_merge(
46 $statusUtility->filterBySeverity($statusObjects, 'error'),
47 $statusUtility->filterBySeverity($statusObjects, 'warning')
48 );
49 $okStatus = array_merge(
50 $statusUtility->filterBySeverity($statusObjects, 'notice'),
51 $statusUtility->filterBySeverity($statusObjects, 'information'),
52 $statusUtility->filterBySeverity($statusObjects, 'ok')
53 );
54
55 /** @var \TYPO3\CMS\Install\FolderStructure\DefaultPermissionsCheck $permissionCheck */
56 $permissionCheck = GeneralUtility::makeInstance(\TYPO3\CMS\Install\FolderStructure\DefaultPermissionsCheck::class);
57 $filePermissionStatus = $permissionCheck->getMaskStatus('fileCreateMask');
58 $directoryPermissionStatus = $permissionCheck->getMaskStatus('folderCreateMask');
59
60 $this->view
61 ->assign('filePermissionStatus', $filePermissionStatus)
62 ->assign('directoryPermissionStatus', $directoryPermissionStatus)
63 ->assign('fixedStatus', $fixedStatusObjects)
64 ->assign('errorStatus', $errorStatus)
65 ->assign('okStatus', $okStatus);
66
67 return $this->view->render();
68 }
69 }