From e41cf0568aa03b44879ddf8caa000c3675d5ce0e Mon Sep 17 00:00:00 2001 From: Rico Sonntag Date: Fri, 1 Mar 2024 09:41:02 +0000 Subject: [PATCH] MFAG-1427: Apply php-cs-fixer rules --- Classes/Command/ImportCommand.php | 5 +- Classes/Controller/TranslationController.php | 78 ++++++++++--------- Classes/Domain/Model/Component.php | 8 +- Classes/Domain/Model/Environment.php | 8 +- Classes/Domain/Model/Translation.php | 55 ++++++------- Classes/Domain/Model/Type.php | 8 +- .../Domain/Repository/AbstractRepository.php | 5 +- .../Domain/Repository/ComponentRepository.php | 15 ++-- .../Repository/EnvironmentRepository.php | 17 ++-- .../Repository/TranslationRepository.php | 38 ++++----- Classes/Domain/Repository/TypeRepository.php | 17 ++-- Classes/Service/ImportService.php | 23 +++--- Classes/Service/TranslationService.php | 4 +- Classes/ViewHelpers/TextdbViewHelper.php | 8 +- Classes/ViewHelpers/TranslateViewHelper.php | 16 ++-- Configuration/Icons.php | 2 +- Configuration/JavaScriptModules.php | 2 +- Configuration/TCA/Overrides/sys_template.php | 2 +- ext_emconf.php | 4 +- ext_tables.php | 2 +- 20 files changed, 169 insertions(+), 148 deletions(-) diff --git a/Classes/Command/ImportCommand.php b/Classes/Command/ImportCommand.php index 0bc7170..8bd98aa 100644 --- a/Classes/Command/ImportCommand.php +++ b/Classes/Command/ImportCommand.php @@ -33,7 +33,7 @@ use function count; /** - * Class ImportCommand + * Class ImportCommand. * * @author Rico Sonntag * @license Netresearch https://www.netresearch.de @@ -170,7 +170,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } /** - * Returns the sys_language_uid for a language code + * Returns the sys_language_uid for a language code. * * @param string $languageCode Language Code * @@ -228,6 +228,7 @@ protected function getLanguageKeyFromFile(string $file): string * @param bool $forceUpdate * * @return void + * * @throws IllegalObjectTypeException */ protected function importTranslationsFromFiles(OutputInterface $output, bool $forceUpdate = false): void diff --git a/Classes/Controller/TranslationController.php b/Classes/Controller/TranslationController.php index cb6d93f..add16c9 100644 --- a/Classes/Controller/TranslationController.php +++ b/Classes/Controller/TranslationController.php @@ -55,7 +55,7 @@ use function is_string; /** - * TranslationController + * TranslationController. * * @author Thomas Schöne * @license Netresearch https://www.netresearch.de @@ -152,14 +152,14 @@ public function __construct( ImportService $importService ) { $this->extensionConfiguration = $extensionConfiguration; - $this->environmentRepository = $environmentRepository; - $this->translationRepository = $translationRepository; - $this->translationService = $translationService; - $this->persistenceManager = $persistenceManager; - $this->componentRepository = $componentRepository; - $this->typeRepository = $typeRepository; - $this->moduleTemplateFactory = $moduleTemplateFactory; - $this->iconFactory = $iconFactory; + $this->environmentRepository = $environmentRepository; + $this->translationRepository = $translationRepository; + $this->translationService = $translationService; + $this->persistenceManager = $persistenceManager; + $this->componentRepository = $componentRepository; + $this->typeRepository = $typeRepository; + $this->moduleTemplateFactory = $moduleTemplateFactory; + $this->iconFactory = $iconFactory; $this->pageRenderer = $pageRenderer; $this->pageRenderer->loadJavaScriptModule('@typo3/backend/modal.js'); @@ -174,7 +174,7 @@ public function __construct( } /** - * Initialize Action + * Initialize Action. * * @return void * @@ -202,7 +202,7 @@ private function moduleResponse(): ResponseInterface } /** - * Shows the textDB entires + * Shows the textDB entires. * * @return ResponseInterface * @@ -249,10 +249,10 @@ public function listAction(): ResponseInterface $value ); - $config['component'] = $componentId; - $config['type'] = $typeId; + $config['component'] = $componentId; + $config['type'] = $typeId; $config['placeholder'] = $placeholder; - $config['value'] = $value; + $config['value'] = $value; $this->persistConfigInBeUserData($config); @@ -533,7 +533,7 @@ public function importAction(bool $update = false): ResponseInterface { $this->view->assign('action', 'import'); - /** @var null|UploadedFile $translationFile */ + /** @var UploadedFile|null $translationFile */ $translationFile = $this->request->getUploadedFiles()['translationFile'] ?? null; if ( @@ -594,6 +594,7 @@ public function importAction(bool $update = false): ResponseInterface } $this->view->assign('errors', $errors); + return $this->moduleResponse(); } @@ -653,41 +654,44 @@ public function importAction(bool $update = false): ResponseInterface } /** - * Get the component from key + * Get the component from key. * * @param string $key * - * @return null|string + * @return string|null */ private function getComponentFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[0] ?? null; } /** - * Get the type from a key + * Get the type from a key. * * @param string $key * - * @return null|string + * @return string|null */ private function getTypeFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[1] ?? null; } /** - * Get the placeholder from key + * Get the placeholder from key. * * @param string $key * - * @return null|string + * @return string|null */ private function getPlaceholderFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[2] ?? null; } @@ -705,7 +709,7 @@ protected function getExtensionConfiguration(): mixed } /** - * Get module config from user data + * Get module config from user data. * * @return array */ @@ -730,7 +734,7 @@ protected function getConfigFromBeUserData(): array } /** - * Save current config in backend user settings + * Save current config in backend user settings. * * @param array $config */ @@ -740,7 +744,7 @@ protected function persistConfigInBeUserData(array $config): void } /** - * Write the translation file for export and returns the uid of entries written to file + * Write the translation file for export and returns the uid of entries written to file. * * @param QueryResultInterface $translations * @param string $exportDir @@ -821,22 +825,22 @@ protected function registerDocHeaderButtons(ModuleTemplate $moduleTemplate): voi // Prepare an array for the button definitions $buttons = [ [ - 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:button.label.list', - 'action' => 'list', - 'icon' => 'actions-list-alternative', - 'group' => 1, + 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:button.label.list', + 'action' => 'list', + 'icon' => 'actions-list-alternative', + 'group' => 1, ], [ - 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:button.label.export', - 'action' => 'export', - 'icon' => 'actions-database-export', - 'group' => 1, + 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:button.label.export', + 'action' => 'export', + 'icon' => 'actions-database-export', + 'group' => 1, ], [ - 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:import', - 'action' => 'import', - 'icon' => 'actions-database-import', - 'group' => 1, + 'label' => 'LLL:EXT:nr_textdb/Resources/Private/Language/locallang.xlf:import', + 'action' => 'import', + 'icon' => 'actions-database-import', + 'group' => 1, ], ]; @@ -955,7 +959,7 @@ protected function addFlashMessageToQueue( } /** - * Shorthand functionality for fetching the language service + * Shorthand functionality for fetching the language service. * * @return LanguageService */ diff --git a/Classes/Domain/Model/Component.php b/Classes/Domain/Model/Component.php index d31e455..9416f73 100644 --- a/Classes/Domain/Model/Component.php +++ b/Classes/Domain/Model/Component.php @@ -15,7 +15,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject; /** - * Component + * Component. * * @author Thomas Schöne * @author Rico Sonntag @@ -25,7 +25,7 @@ class Component extends AbstractValueObject { /** - * name + * name. * * @var string * @@ -34,7 +34,7 @@ class Component extends AbstractValueObject protected string $name = ''; /** - * Returns the name + * Returns the name. * * @return string */ @@ -44,7 +44,7 @@ public function getName(): string } /** - * Sets the name + * Sets the name. * * @param string $name * diff --git a/Classes/Domain/Model/Environment.php b/Classes/Domain/Model/Environment.php index 445c396..de1554b 100644 --- a/Classes/Domain/Model/Environment.php +++ b/Classes/Domain/Model/Environment.php @@ -15,7 +15,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject; /** - * Environment + * Environment. * * @author Thomas Schöne * @author Rico Sonntag @@ -25,7 +25,7 @@ class Environment extends AbstractValueObject { /** - * name + * name. * * @var string * @@ -34,7 +34,7 @@ class Environment extends AbstractValueObject protected string $name = ''; /** - * Returns the name + * Returns the name. * * @return string */ @@ -44,7 +44,7 @@ public function getName(): string } /** - * Sets the name + * Sets the name. * * @param string $name * diff --git a/Classes/Domain/Model/Translation.php b/Classes/Domain/Model/Translation.php index 43ce5d5..ca244e2 100644 --- a/Classes/Domain/Model/Translation.php +++ b/Classes/Domain/Model/Translation.php @@ -16,7 +16,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; /** - * Translation + * Translation. * * @author Thomas Schöne * @author Rico Sonntag @@ -26,28 +26,28 @@ class Translation extends AbstractEntity { /** - * environment + * environment. * - * @var null|Environment + * @var Environment|null */ protected ?Environment $environment = null; /** - * component + * component. * - * @var null|Component + * @var Component|null */ protected ?Component $component = null; /** - * type + * type. * - * @var null|Type + * @var Type|null */ protected ?Type $type = null; /** - * Placeholder + * Placeholder. * * @var string * @@ -56,7 +56,7 @@ class Translation extends AbstractEntity protected string $placeholder = ''; /** - * value + * value. * * @var string * @@ -85,9 +85,9 @@ class Translation extends AbstractEntity protected int $sysLanguageUid = 0; /** - * Returns the environment + * Returns the environment. * - * @return null|Environment + * @return Environment|null */ public function getEnvironment(): ?Environment { @@ -95,9 +95,9 @@ public function getEnvironment(): ?Environment } /** - * Sets the environment + * Sets the environment. * - * @param null|Environment $environment + * @param Environment|null $environment * * @return void */ @@ -107,9 +107,9 @@ public function setEnvironment(?Environment $environment): void } /** - * Returns the component + * Returns the component. * - * @return null|Component + * @return Component|null */ public function getComponent(): ?Component { @@ -117,9 +117,9 @@ public function getComponent(): ?Component } /** - * Sets the component + * Sets the component. * - * @param null|Component $component + * @param Component|null $component * * @return void */ @@ -129,9 +129,9 @@ public function setComponent(?Component $component): void } /** - * Returns the type + * Returns the type. * - * @return null|Type + * @return Type|null */ public function getType(): ?Type { @@ -139,9 +139,9 @@ public function getType(): ?Type } /** - * Sets the type + * Sets the type. * - * @param null|Type $type + * @param Type|null $type * * @return void */ @@ -166,11 +166,12 @@ public function getPlaceholder(): string public function setPlaceholder(string $placeholder): Translation { $this->placeholder = $placeholder; + return $this; } /** - * Returns the value + * Returns the value. * * @return string */ @@ -184,7 +185,7 @@ public function getValue(): string } /** - * Sets the value + * Sets the value. * * @param string $value * @@ -212,7 +213,7 @@ public function isDeleted(): bool } /** - * Return the language uid + * Return the language uid. * * @return int */ @@ -222,7 +223,7 @@ public function getLanguageUid(): int } /** - * Set the language UID + * Set the language UID. * * @param int $languageUid * @@ -281,11 +282,13 @@ public function getSysLanguageUid(): int public function setSysLanguageUid(int $sysLanguageUid): Translation { $this->sysLanguageUid = $sysLanguageUid; + return $this; } /** - * Returns true if the entry was auto-created by the repository + * Returns true if the entry was auto-created by the repository. + * * @return bool */ public function isAutoCreated(): bool diff --git a/Classes/Domain/Model/Type.php b/Classes/Domain/Model/Type.php index 7be15d2..0768dc3 100644 --- a/Classes/Domain/Model/Type.php +++ b/Classes/Domain/Model/Type.php @@ -15,7 +15,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject; /** - * Type + * Type. * * @author Thomas Schöne * @author Rico Sonntag @@ -25,7 +25,7 @@ class Type extends AbstractValueObject { /** - * name + * name. * * @var string * @@ -34,7 +34,7 @@ class Type extends AbstractValueObject protected string $name = ''; /** - * Returns the name + * Returns the name. * * @return string */ @@ -44,7 +44,7 @@ public function getName(): string } /** - * Sets the name + * Sets the name. * * @param string $name * diff --git a/Classes/Domain/Repository/AbstractRepository.php b/Classes/Domain/Repository/AbstractRepository.php index 9e3ebbc..f83d7c7 100644 --- a/Classes/Domain/Repository/AbstractRepository.php +++ b/Classes/Domain/Repository/AbstractRepository.php @@ -17,7 +17,7 @@ use TYPO3\CMS\Extbase\Persistence\Repository; /** - * AbstractRepository + * AbstractRepository. * * @author Axel Seemann * @author Rico Sonntag @@ -25,6 +25,7 @@ * @link https://www.netresearch.de * * @template T of \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface + * * @extends Repository */ class AbstractRepository extends Repository @@ -46,6 +47,7 @@ private function getExtensionConfiguration(string $path): mixed try { /** @var ExtensionConfiguration $extensionConfiguration */ $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class); + return $extensionConfiguration->get('nr_textdb', $path); } catch (Exception) { return null; @@ -73,6 +75,7 @@ public function getConfiguredPageId(): int public function setCreateIfMissing(bool $createIfMissing): self { $this->createIfMissing = $createIfMissing; + return $this; } diff --git a/Classes/Domain/Repository/ComponentRepository.php b/Classes/Domain/Repository/ComponentRepository.php index 597f58c..f57c95a 100644 --- a/Classes/Domain/Repository/ComponentRepository.php +++ b/Classes/Domain/Repository/ComponentRepository.php @@ -17,7 +17,7 @@ use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; /** - * ComponentRepository + * ComponentRepository. * * @author Thomas Schöne * @author Axel Seemann @@ -52,7 +52,7 @@ public function initializeObject(): void * * @param string $name Name of Component * - * @return null|Component + * @return Component|null * * @throws IllegalObjectTypeException */ @@ -86,7 +86,7 @@ public function findByName(string $name): ?Component return $this->setToCache($name, $component); } - /** @var null|Component $component */ + /** @var Component|null $component */ $component = $queryResult->getFirst(); return $this->setToCache($name, $component); @@ -96,22 +96,23 @@ public function findByName(string $name): ?Component * Set a Component to Cache and return it. * * @param string $key CacheKey - * @param null|Component $component Component to cache + * @param Component|null $component Component to cache * - * @return null|Component + * @return Component|null */ private function setToCache(string $key, ?Component $component): ?Component { static::$localCache[$key] = $component; + return $component; } /** - * Returns a component from cache + * Returns a component from cache. * * @param string $key Cache Key * - * @return null|Component + * @return Component|null */ private function getFromCache(string $key): ?Component { diff --git a/Classes/Domain/Repository/EnvironmentRepository.php b/Classes/Domain/Repository/EnvironmentRepository.php index 1e19de9..3d223d0 100644 --- a/Classes/Domain/Repository/EnvironmentRepository.php +++ b/Classes/Domain/Repository/EnvironmentRepository.php @@ -17,7 +17,7 @@ use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; /** - * EnvironmentRepository + * EnvironmentRepository. * * @author Thomas Schöne * @author Axel Seemann @@ -50,7 +50,7 @@ public function initializeObject(): void /** * @param string $name Name of environment * - * @return null|Environment + * @return Environment|null * * @throws IllegalObjectTypeException */ @@ -84,32 +84,33 @@ public function findByName(string $name): ?Environment return $this->setToCache($name, $environment); } - /** @var null|Environment $environment */ + /** @var Environment|null $environment */ $environment = $queryResult->getFirst(); return $this->setToCache($name, $environment); } /** - * Set environment to local cache + * Set environment to local cache. * * @param string $key Cache Key - * @param null|Environment $environment Environment which is set to cache + * @param Environment|null $environment Environment which is set to cache * - * @return null|Environment + * @return Environment|null */ private function setToCache(string $key, ?Environment $environment): ?Environment { static::$localCache[$key] = $environment; + return $environment; } /** - * Returns the environment from Cache + * Returns the environment from Cache. * * @param string $key Cache key * - * @return null|Environment + * @return Environment|null */ private function getFromCache(string $key): ?Environment { diff --git a/Classes/Domain/Repository/TranslationRepository.php b/Classes/Domain/Repository/TranslationRepository.php index 2ef6aa6..2d2fce9 100644 --- a/Classes/Domain/Repository/TranslationRepository.php +++ b/Classes/Domain/Repository/TranslationRepository.php @@ -27,7 +27,7 @@ use function func_get_args; /** - * TranslationRepository + * TranslationRepository. * * @author Thomas Schöne * @author Axel Seemann @@ -36,6 +36,7 @@ * @link https://www.netresearch.de * * @template T of \Netresearch\NrTextdb\Domain\Model\Translation + * * @extends AbstractRepository */ class TranslationRepository extends AbstractRepository @@ -140,9 +141,9 @@ public function findAllByLanguage(int $languageUid): QueryResultInterface * @param string $type Type of the translation * @param string $placeholder Value of the translation * @param int $languageUid uid of the language - * @param bool $create If set to true, translation will be automatically created if it is missing. + * @param bool $create if set to true, translation will be automatically created if it is missing * - * @return null|Translation + * @return Translation|null * * @throws IllegalObjectTypeException * @throws JsonException @@ -195,7 +196,7 @@ public function findEntry( $queryResult = $query->execute(); - /** @var null|Translation $translation */ + /** @var Translation|null $translation */ $translation = null; /** @var Translation $result */ @@ -236,7 +237,7 @@ public function findEntry( } /** - * Find a translation record + * Find a translation record. * * @param Environment $environment * @param Component $component @@ -246,7 +247,7 @@ public function findEntry( * @param bool $skipCreation * @param bool $fallback * - * @return null|Translation + * @return Translation|null * * @throws IllegalObjectTypeException * @throws JsonException @@ -340,7 +341,7 @@ public function find( } /** - * Set a translation to cache and return the translation + * Set a translation to cache and return the translation. * * @param string $key Cache key * @param Translation $translation Translation to cache @@ -350,15 +351,16 @@ public function find( private function setToCache(string $key, Translation $translation): Translation { static::$localCache[$key] = $translation; + return $translation; } /** - * Returns a cached translation + * Returns a cached translation. * * @param string $key Cache key * - * @return null|Translation + * @return Translation|null */ private function getFromCache(string $key): ?Translation { @@ -420,7 +422,7 @@ public function createTranslation( } /** - * Returns an array with translations for a record + * Returns an array with translations for a record. * * @param int $uid Uid of original * @@ -447,11 +449,11 @@ public function getTranslatedRecords(int $uid): array } /** - * Returns a record found by its uid without any restrictions + * Returns a record found by its uid without any restrictions. * * @param int $uid UID * - * @return null|Translation + * @return Translation|null */ public function findRecordByUid(int $uid): ?Translation { @@ -465,19 +467,19 @@ public function findRecordByUid(int $uid): ?Translation $query->equals('uid', $uid) ); - /** @var null|Translation $translation */ + /** @var Translation|null $translation */ $translation = $query->execute()->getFirst(); return $translation; } /** - * Returns all records by given filters + * Returns all records by given filters. * * @param int $component Component ID * @param int $type Type ID - * @param null|string $placeholder Placeholder to search for - * @param null|string $value Value to search for + * @param string|null $placeholder Placeholder to search for + * @param string|null $value Value to search for * @param int $langaugeId Language ID * * @return QueryResultInterface @@ -487,8 +489,8 @@ public function findRecordByUid(int $uid): ?Translation public function getAllRecordsByIdentifier( int $component = 0, int $type = 0, - string $placeholder = null, - string $value = null, + ?string $placeholder = null, + ?string $value = null, int $langaugeId = 0 ): QueryResultInterface { $query = $this->createQuery(); diff --git a/Classes/Domain/Repository/TypeRepository.php b/Classes/Domain/Repository/TypeRepository.php index fe69f94..b0eb113 100644 --- a/Classes/Domain/Repository/TypeRepository.php +++ b/Classes/Domain/Repository/TypeRepository.php @@ -17,7 +17,7 @@ use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; /** - * TypeRepository + * TypeRepository. * * @author Thomas Schöne * @author Axel Seemann @@ -52,7 +52,7 @@ public function initializeObject(): void * * @param string $name Name of a type * - * @return null|Type + * @return Type|null * * @throws IllegalObjectTypeException */ @@ -89,32 +89,33 @@ public function findByName(string $name): ?Type return $this->setToCache($name, $type); } - /** @var null|Type $type */ + /** @var Type|null $type */ $type = $queryResult->getFirst(); return $this->setToCache($name, $type); } /** - * Set a type to cache and return it + * Set a type to cache and return it. * * @param string $key Cache key - * @param null|Type $type Type to cache + * @param Type|null $type Type to cache * - * @return null|Type + * @return Type|null */ private function setToCache(string $key, ?Type $type): ?Type { static::$localCache[$key] = $type; + return $type; } /** - * Return a cached type + * Return a cached type. * * @param string $key Cache key * - * @return null|Type + * @return Type|null */ private function getFromCache(string $key): ?Type { diff --git a/Classes/Service/ImportService.php b/Classes/Service/ImportService.php index 1a8892a..bf442dd 100644 --- a/Classes/Service/ImportService.php +++ b/Classes/Service/ImportService.php @@ -156,8 +156,8 @@ public function importFile( * Imports a single entry into the database. * * @param int $languageUid - * @param null|string $componentName - * @param null|string $typeName + * @param string|null $componentName + * @param string|null $typeName * @param string $placeholder * @param string $value * @param bool $forceUpdate @@ -292,7 +292,7 @@ private function getLanguageKeyFromFile(string $file): string } /** - * Returns the sys_language_uid for a language code + * Returns the sys_language_uid for a language code. * * @param string $languageCode Language Code * @@ -324,45 +324,49 @@ private function getAllLanguages(): array $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); $sites = $siteFinder->getAllSites(); + return reset($sites)->getAllLanguages(); } /** - * Get the component from key + * Get the component from key. * * @param string $key * - * @return null|string + * @return string|null */ private function getComponentFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[0] ?? null; } /** - * Get the type from a key + * Get the type from a key. * * @param string $key * - * @return null|string + * @return string|null */ private function getTypeFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[1] ?? null; } /** - * Get the placeholder from key + * Get the placeholder from key. * * @param string $key * - * @return null|string + * @return string|null */ private function getPlaceholderFromKey(string $key): ?string { $parts = explode('|', $key); + return $parts[2] ?? null; } @@ -378,6 +382,7 @@ private function getExtensionConfiguration(string $path): mixed try { /** @var ExtensionConfiguration $extensionConfiguration */ $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class); + return $extensionConfiguration->get('nr_textdb', $path); } catch (Exception) { return null; diff --git a/Classes/Service/TranslationService.php b/Classes/Service/TranslationService.php index 32eb99a..91936f8 100644 --- a/Classes/Service/TranslationService.php +++ b/Classes/Service/TranslationService.php @@ -25,7 +25,7 @@ use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; /** - * The translation service + * The translation service. * * @author Thomas Schöne * @author Rico Sonntag @@ -83,7 +83,7 @@ public function __construct( } /** - * Translate method + * Translate method. * * @param string $placeholder The translation key * @param string $type List of parameters for translation string diff --git a/Classes/ViewHelpers/TextdbViewHelper.php b/Classes/ViewHelpers/TextdbViewHelper.php index f4bf24f..582e32f 100644 --- a/Classes/ViewHelpers/TextdbViewHelper.php +++ b/Classes/ViewHelpers/TextdbViewHelper.php @@ -29,14 +29,14 @@ class TextdbViewHelper extends AbstractViewHelper { /** - * Translation service instance + * Translation service instance. * - * @var null|TranslationService + * @var TranslationService|null */ protected ?TranslationService $translationService = null; /** - * Initializes arguments (attributes) + * Initializes arguments (attributes). * * @return void */ @@ -76,7 +76,7 @@ public function initializeArguments(): void } /** - * Render translated string + * Render translated string. * * @return string The translated key or tag body if key doesn't exist * diff --git a/Classes/ViewHelpers/TranslateViewHelper.php b/Classes/ViewHelpers/TranslateViewHelper.php index 89ae4f5..a4b01a4 100644 --- a/Classes/ViewHelpers/TranslateViewHelper.php +++ b/Classes/ViewHelpers/TranslateViewHelper.php @@ -27,7 +27,7 @@ /** * Fluid implementation - * Provides a way import LLL Keys from f:translate to textdb + * Provides a way import LLL Keys from f:translate to textdb. * * @author Tobias Hein * @author Rico Sonntag @@ -44,21 +44,21 @@ class TranslateViewHelper extends AbstractViewHelper final public const LANGUAGE_UID_EN = 1; /** - * Translation service instance + * Translation service instance. * - * @var null|TranslationRepository + * @var TranslationRepository|null */ protected ?TranslationRepository $translationRepository = null; /** - * Component which can be used for a migration step + * Component which can be used for a migration step. * * @var string */ public static string $component = ''; /** - * Initializes arguments (attributes) + * Initializes arguments (attributes). * * @return void */ @@ -89,7 +89,7 @@ public function initializeArguments(): void } /** - * Render translated string + * Render translated string. * * @return string The translated key or tag body if key doesn't exist * @@ -125,7 +125,7 @@ public function render(): string } if ($this->hasTextDbEntry($placeholder)) { - return (string) $translationRequested; + return (string) $translationRequested; } try { @@ -189,7 +189,7 @@ private function getLanguageUid(): int } /** - * Returns true, if a textdb translation exisits + * Returns true, if a textdb translation exisits. * * @param string $placeholder * diff --git a/Configuration/Icons.php b/Configuration/Icons.php index d36f65f..48fd35b 100644 --- a/Configuration/Icons.php +++ b/Configuration/Icons.php @@ -14,6 +14,6 @@ return [ 'tx-textdb-module-web' => [ 'provider' => SvgIconProvider::class, - 'source' => 'EXT:nr_textdb/Resources/Public/Icons/Extension.svg', + 'source' => 'EXT:nr_textdb/Resources/Public/Icons/Extension.svg', ], ]; diff --git a/Configuration/JavaScriptModules.php b/Configuration/JavaScriptModules.php index 993b088..1ec7b43 100644 --- a/Configuration/JavaScriptModules.php +++ b/Configuration/JavaScriptModules.php @@ -14,7 +14,7 @@ 'core', 'backend', ], - 'imports' => [ + 'imports' => [ '@netresearch/nr-textdb/' => 'EXT:nr_textdb/Resources/Public/JavaScript/', ], ]; diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index a2be063..c0748f4 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -11,7 +11,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -defined('TYPO3') || die('Access denied.'); +defined('TYPO3') || exit('Access denied.'); call_user_func(static function () { ExtensionManagementUtility::addStaticFile( diff --git a/ext_emconf.php b/ext_emconf.php index 8f7b7dd..74a564f 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -19,12 +19,12 @@ 'state' => 'stable', 'version' => '1.0.3', 'constraints' => [ - 'depends' => [ + 'depends' => [ 'typo3' => '12.4.0-12.99.99', ], 'conflicts' => [ ], - 'suggests' => [ + 'suggests' => [ ], ], ]; diff --git a/ext_tables.php b/ext_tables.php index 1c1dabb..f7d0c2d 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -12,7 +12,7 @@ use Netresearch\NrTextdb\Hooks\Sync; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -defined('TYPO3') || die('Access denied.'); +defined('TYPO3') || exit('Access denied.'); call_user_func(static function () { // Sync