Skip to content

Commit

Permalink
MFAG-1427: Apply php-cs-fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsunday committed Mar 1, 2024
1 parent c75d4d1 commit e41cf05
Show file tree
Hide file tree
Showing 20 changed files with 169 additions and 148 deletions.
5 changes: 3 additions & 2 deletions Classes/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
use function count;

/**
* Class ImportCommand
* Class ImportCommand.
*
* @author Rico Sonntag <[email protected]>
* @license Netresearch https://www.netresearch.de
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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
Expand Down
78 changes: 41 additions & 37 deletions Classes/Controller/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
use function is_string;

/**
* TranslationController
* TranslationController.
*
* @author Thomas Schöne <[email protected]>
* @license Netresearch https://www.netresearch.de
Expand Down Expand Up @@ -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');
Expand All @@ -174,7 +174,7 @@ public function __construct(
}

/**
* Initialize Action
* Initialize Action.
*
* @return void
*
Expand Down Expand Up @@ -202,7 +202,7 @@ private function moduleResponse(): ResponseInterface
}

/**
* Shows the textDB entires
* Shows the textDB entires.
*
* @return ResponseInterface
*
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -594,6 +594,7 @@ public function importAction(bool $update = false): ResponseInterface
}

$this->view->assign('errors', $errors);

return $this->moduleResponse();
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -705,7 +709,7 @@ protected function getExtensionConfiguration(): mixed
}

/**
* Get module config from user data
* Get module config from user data.
*
* @return array<array-key, int|string>
*/
Expand All @@ -730,7 +734,7 @@ protected function getConfigFromBeUserData(): array
}

/**
* Save current config in backend user settings
* Save current config in backend user settings.
*
* @param array<array-key, int|string> $config
*/
Expand All @@ -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
Expand Down Expand Up @@ -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,
],
];

Expand Down Expand Up @@ -955,7 +959,7 @@ protected function addFlashMessageToQueue(
}

/**
* Shorthand functionality for fetching the language service
* Shorthand functionality for fetching the language service.
*
* @return LanguageService
*/
Expand Down
8 changes: 4 additions & 4 deletions Classes/Domain/Model/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;

/**
* Component
* Component.
*
* @author Thomas Schöne <[email protected]>
* @author Rico Sonntag <[email protected]>
Expand All @@ -25,7 +25,7 @@
class Component extends AbstractValueObject
{
/**
* name
* name.
*
* @var string
*
Expand All @@ -34,7 +34,7 @@ class Component extends AbstractValueObject
protected string $name = '';

/**
* Returns the name
* Returns the name.
*
* @return string
*/
Expand All @@ -44,7 +44,7 @@ public function getName(): string
}

/**
* Sets the name
* Sets the name.
*
* @param string $name
*
Expand Down
8 changes: 4 additions & 4 deletions Classes/Domain/Model/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject;

/**
* Environment
* Environment.
*
* @author Thomas Schöne <[email protected]>
* @author Rico Sonntag <[email protected]>
Expand All @@ -25,7 +25,7 @@
class Environment extends AbstractValueObject
{
/**
* name
* name.
*
* @var string
*
Expand All @@ -34,7 +34,7 @@ class Environment extends AbstractValueObject
protected string $name = '';

/**
* Returns the name
* Returns the name.
*
* @return string
*/
Expand All @@ -44,7 +44,7 @@ public function getName(): string
}

/**
* Sets the name
* Sets the name.
*
* @param string $name
*
Expand Down
Loading

0 comments on commit e41cf05

Please sign in to comment.