From 42cfec06ef5ca4ea3e92e7e373e32330f7c17779 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 28 Mar 2026 15:25:29 +0100 Subject: [PATCH] [CLEANUP] Autoformat the code --- Build/php-cs-fixer/config.php | 4 +- .../Controller/BackendModuleController.php | 2 +- .../AbstractListTypeToCTypeUpdate.php | 27 ++++- .../Private/Language/locallang_index_mod.xlf | 52 ++++----- Resources/Private/Layouts/Default.html | 6 +- Resources/Private/Layouts/FrontEndEditor.html | 20 ++-- .../Private/Partials/FrontEndEditor/Form.html | 58 +++++----- .../FrontEndEditor/ValidationResult.html | 18 +-- .../Templates/BackendModule/Index.html | 74 ++++++++----- .../Templates/FrontEndEditor/Edit.html | 18 +-- .../Templates/FrontEndEditor/Index.html | 104 +++++++++--------- .../Private/Templates/FrontEndEditor/New.html | 18 +-- Resources/Private/Templates/Tea/Index.html | 88 +++++++-------- Resources/Private/Templates/Tea/Show.html | 14 +-- .../BackendModuleControllerTest.php | 11 +- .../Upgrades/ListTypeToCTypeUpdateTest.php | 12 +- 16 files changed, 280 insertions(+), 246 deletions(-) diff --git a/Build/php-cs-fixer/config.php b/Build/php-cs-fixer/config.php index a133432e8..58477b12e 100644 --- a/Build/php-cs-fixer/config.php +++ b/Build/php-cs-fixer/config.php @@ -14,8 +14,8 @@ 'include' => [], 'scope' => 'all', 'strict' => true, - ] - ] + ], + ], ); $config->getFinder()->in('Classes')->in('Configuration')->in('Tests'); return $config; diff --git a/Classes/Controller/BackendModuleController.php b/Classes/Controller/BackendModuleController.php index bf9768d97..e30fd8031 100644 --- a/Classes/Controller/BackendModuleController.php +++ b/Classes/Controller/BackendModuleController.php @@ -30,7 +30,7 @@ public function indexAction(): ResponseInterface $this->addFlashMessage( LocalizationUtility::translate(self::TRANSLATE_KEY_PREFIX . 'flash_message.missing_teas.message') ?? '', LocalizationUtility::translate(self::TRANSLATE_KEY_PREFIX . 'flash_message.missing_teas.title') ?? '', - ContextualFeedbackSeverity::WARNING + ContextualFeedbackSeverity::WARNING, ); } diff --git a/Classes/Upgrades/AbstractListTypeToCTypeUpdate.php b/Classes/Upgrades/AbstractListTypeToCTypeUpdate.php index c166f5265..37d9d8d4b 100644 --- a/Classes/Upgrades/AbstractListTypeToCTypeUpdate.php +++ b/Classes/Upgrades/AbstractListTypeToCTypeUpdate.php @@ -186,6 +186,7 @@ protected function hasNoLegacyBackendGroupsExplicitAllowDenyConfiguration(): boo /** @phpstan-ignore cast.int */ return (int)$queryBuilder->executeQuery()->fetchOne() === 0; } + /** @phpstan-ignore missingType.iterableValue */ protected function getContentElementsToUpdate(string $listType): array { @@ -201,6 +202,7 @@ protected function getContentElementsToUpdate(string $listType): array return $queryBuilder->executeQuery()->fetchAllAssociative(); } + /** @phpstan-ignore missingType.iterableValue */ protected function getBackendUserGroupsToUpdate(string $listType): array { @@ -266,21 +268,36 @@ protected function updateBackendUserGroups(): void private function validateRequirements(): void { if ($this->getTitle() === '') { - throw new \RuntimeException('The update class "' . static::class . '" must provide a title by extending "getTitle()"', 1727605675); + throw new \RuntimeException( + 'The update class "' . static::class . '" must provide a title by extending "getTitle()"', + 1727605675, + ); } if ($this->getDescription() === '') { - throw new \RuntimeException('The update class "' . static::class . '" must provide a description by extending "getDescription()"', 1727605676); + throw new \RuntimeException( + 'The update class "' . static::class . '" must provide a description by extending "getDescription()"', + 1727605676, + ); } if ($this->getListTypeToCTypeMapping() === []) { - throw new \RuntimeException('The update class "' . static::class . '" does not provide a "list_type" to "CType" migration mapping', 1727605677); + throw new \RuntimeException( + 'The update class "' . static::class . '" does not provide a "list_type" to "CType" migration mapping', + 1727605677, + ); } foreach ($this->getListTypeToCTypeMapping() as $listType => $contentElement) { if ($listType === '') { - throw new \RuntimeException('Invalid mapping item "' . $listType . '" in class "' . static::class, 1727605678); + throw new \RuntimeException( + 'Invalid mapping item "' . $listType . '" in class "' . static::class, + 1727605678, + ); } if ($contentElement === '') { - throw new \RuntimeException('Invalid mapping item "' . $contentElement . '" in class "' . static::class, 1727605679); + throw new \RuntimeException( + 'Invalid mapping item "' . $contentElement . '" in class "' . static::class, + 1727605679, + ); } } } diff --git a/Resources/Private/Language/locallang_index_mod.xlf b/Resources/Private/Language/locallang_index_mod.xlf index daf90546e..8b3cc1c09 100644 --- a/Resources/Private/Language/locallang_index_mod.xlf +++ b/Resources/Private/Language/locallang_index_mod.xlf @@ -1,29 +1,29 @@ - -
- - - Teas - - - Maintain teas - - - This module allows you to work with teas. - - - UID - - - Currently, there are no teas. - - - No Teas available yet - - - All available teas from the installation. - - - + +
+ + + Teas + + + Maintain teas + + + This module allows you to work with teas. + + + UID + + + Currently, there are no teas. + + + No Teas available yet + + + All available teas from the installation. + + + diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html index c96b50c90..d71e7ebc6 100644 --- a/Resources/Private/Layouts/Default.html +++ b/Resources/Private/Layouts/Default.html @@ -1,5 +1,5 @@ -
- -
+
+ +
diff --git a/Resources/Private/Layouts/FrontEndEditor.html b/Resources/Private/Layouts/FrontEndEditor.html index f92edfce5..79f9ee1c2 100644 --- a/Resources/Private/Layouts/FrontEndEditor.html +++ b/Resources/Private/Layouts/FrontEndEditor.html @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + diff --git a/Resources/Private/Partials/FrontEndEditor/Form.html b/Resources/Private/Partials/FrontEndEditor/Form.html index 8cb35cba0..4f14963db 100644 --- a/Resources/Private/Partials/FrontEndEditor/Form.html +++ b/Resources/Private/Partials/FrontEndEditor/Form.html @@ -1,36 +1,36 @@ - - + + -
-
- -
- - -
+
+
+ +
+ +
+
-
- -
- - -
+
+ +
+ +
-
- -
- - - -
+
+ +
+ + + + +
diff --git a/Resources/Private/Partials/FrontEndEditor/ValidationResult.html b/Resources/Private/Partials/FrontEndEditor/ValidationResult.html index e924eca33..be090640a 100644 --- a/Resources/Private/Partials/FrontEndEditor/ValidationResult.html +++ b/Resources/Private/Partials/FrontEndEditor/ValidationResult.html @@ -1,11 +1,11 @@ - - - -
- {error.message} -
-
-
-
+ + + +
+ {error.message} +
+
+
+
diff --git a/Resources/Private/Templates/BackendModule/Index.html b/Resources/Private/Templates/BackendModule/Index.html index 0385f3fee..19d9a4eba 100644 --- a/Resources/Private/Templates/BackendModule/Index.html +++ b/Resources/Private/Templates/BackendModule/Index.html @@ -3,37 +3,53 @@ xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" data-namespace-typo3-fluid="true" > - + - -

+ +

+ +

- + - - - -
+ + + +
- -
- - - - - - - - - - - - - - - - -
{tea.uid}{tea.title}
-
-
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + +
+ {tea.uid} + + + {tea.title} + +
+
+
diff --git a/Resources/Private/Templates/FrontEndEditor/Edit.html b/Resources/Private/Templates/FrontEndEditor/Edit.html index 0635cc2e8..8b0f8fa6c 100644 --- a/Resources/Private/Templates/FrontEndEditor/Edit.html +++ b/Resources/Private/Templates/FrontEndEditor/Edit.html @@ -1,14 +1,14 @@ - + - -

- -

+ +

+ +

- - - -
+ + + +
diff --git a/Resources/Private/Templates/FrontEndEditor/Index.html b/Resources/Private/Templates/FrontEndEditor/Index.html index fd89ad4dc..ac78251b9 100644 --- a/Resources/Private/Templates/FrontEndEditor/Index.html +++ b/Resources/Private/Templates/FrontEndEditor/Index.html @@ -1,60 +1,60 @@ - + - -

- -

+ +

+ +

- + - - - + + +
+ + + + + + - - - + + + + - - - - - - - - -
+ + + + + +
- - - - - - + {tea.uid} + + {tea.title} + + + + + + + + +
- {tea.uid} - - {tea.title} - - - - - - - - -
-
- - - -
-
+ + + + + + + +
diff --git a/Resources/Private/Templates/FrontEndEditor/New.html b/Resources/Private/Templates/FrontEndEditor/New.html index 926476129..4973c4916 100644 --- a/Resources/Private/Templates/FrontEndEditor/New.html +++ b/Resources/Private/Templates/FrontEndEditor/New.html @@ -1,14 +1,14 @@ - + - -

- -

+ +

+ +

- - - -
+ + + +
diff --git a/Resources/Private/Templates/Tea/Index.html b/Resources/Private/Templates/Tea/Index.html index 3c366d4d3..a25e64fed 100644 --- a/Resources/Private/Templates/Tea/Index.html +++ b/Resources/Private/Templates/Tea/Index.html @@ -1,50 +1,50 @@ - + - -

- -

+ +

+ +

- - - - - -

- -

-
-
-
+ + + + + +

+ +

+
+
+
- - - - - - - - - - - - - - - - -
- - - -
- {tea.uid} - - - {tea.title} - -
-
+ + + + + + + + + + + + + + + + +
+ + + +
+ {tea.uid} + + + {tea.title} + +
+
diff --git a/Resources/Private/Templates/Tea/Show.html b/Resources/Private/Templates/Tea/Show.html index 9bea907d1..8e5047192 100644 --- a/Resources/Private/Templates/Tea/Show.html +++ b/Resources/Private/Templates/Tea/Show.html @@ -1,12 +1,12 @@ - + - -

- {tea.title} -

+ +

+ {tea.title} +

- {tea.description -> f:format.html()} -
+ {tea.description -> f:format.html()} +
diff --git a/Tests/Functional/Controller/BackendModuleControllerTest.php b/Tests/Functional/Controller/BackendModuleControllerTest.php index 358aefdeb..476a83a5d 100644 --- a/Tests/Functional/Controller/BackendModuleControllerTest.php +++ b/Tests/Functional/Controller/BackendModuleControllerTest.php @@ -97,7 +97,7 @@ public function indexListsTeasFromSortedByUidInDescendingOrder(): void self::assertLessThan( strpos($html, 'Tea 1'), strpos($html, 'Tea 2'), - 'Tea 1 is not sorted after Tea 2' + 'Tea 1 is not sorted after Tea 2', ); } @@ -192,7 +192,7 @@ public function indexLinksTeaValuesToEditForm(): void private function executeRequest( string $route, string $pluginName, - string $action + string $action, ): ResponseInterface { $request = $this->createRequest( $route, @@ -214,10 +214,11 @@ private function executeRequest( Environment::getVarPath(), Environment::getConfigPath(), Environment::getCurrentScript(), - Environment::toArray()['os'] + Environment::toArray()['os'], ); - $response = $this->get(BackendModuleController::class) + $response = $this + ->get(BackendModuleController::class) ->processRequest(new Request($request)); Environment::initialize( @@ -229,7 +230,7 @@ private function executeRequest( Environment::getVarPath(), Environment::getConfigPath(), Environment::getCurrentScript(), - Environment::toArray()['os'] + Environment::toArray()['os'], ); return $response; diff --git a/Tests/Functional/Upgrades/ListTypeToCTypeUpdateTest.php b/Tests/Functional/Upgrades/ListTypeToCTypeUpdateTest.php index cf1b2173f..9d8713d0f 100644 --- a/Tests/Functional/Upgrades/ListTypeToCTypeUpdateTest.php +++ b/Tests/Functional/Upgrades/ListTypeToCTypeUpdateTest.php @@ -64,7 +64,7 @@ public function hasListTypeToCTypeMapping(): void public function updateNecessary(): void { $this->importCSVDataSet( - self::FIXTURES_PREFIX . 'PluginAsListType.csv' + self::FIXTURES_PREFIX . 'PluginAsListType.csv', ); self::assertTrue($this->subject->updateNecessary()); } @@ -73,7 +73,7 @@ public function updateNecessary(): void public function updateNotNecessary(): void { $this->importCSVDataSet( - self::ASSERTIONS_PREFIX . 'PluginAsCType.csv' + self::ASSERTIONS_PREFIX . 'PluginAsCType.csv', ); self::assertFalse($this->subject->updateNecessary()); } @@ -82,14 +82,14 @@ public function updateNotNecessary(): void public function executeUpdateOnListType(): void { $this->importCSVDataSet( - self::FIXTURES_PREFIX . 'PluginAsListType.csv' + self::FIXTURES_PREFIX . 'PluginAsListType.csv', ); self::assertTrue($this->subject->updateNecessary()); $result = $this->subject->executeUpdate(); self::assertTrue($result); self::assertFalse($this->subject->updateNecessary()); $this->assertCSVDataSet( - self::ASSERTIONS_PREFIX . 'PluginAsCType.csv' + self::ASSERTIONS_PREFIX . 'PluginAsCType.csv', ); } @@ -97,13 +97,13 @@ public function executeUpdateOnListType(): void public function executeUpdateOnCType(): void { $this->importCSVDataSet( - self::ASSERTIONS_PREFIX . 'PluginAsCType.csv' + self::ASSERTIONS_PREFIX . 'PluginAsCType.csv', ); self::assertFalse($this->subject->updateNecessary()); $result = $this->subject->executeUpdate(); self::assertTrue($result); $this->assertCSVDataSet( - self::ASSERTIONS_PREFIX . 'PluginAsCType.csv' + self::ASSERTIONS_PREFIX . 'PluginAsCType.csv', ); }