From cc0af424fa8a7e019077fb7a7170c6bfbaea1815 Mon Sep 17 00:00:00 2001 From: Christian Dangl Date: Thu, 21 Dec 2023 22:52:31 +0100 Subject: [PATCH] apply php cs fixer files --- src/AppManager.php | 3 +-- src/Bundles/Exchange/CSV/CSVExchange.php | 7 +++---- .../Exchange/CSV/Services/CSVExporter.php | 7 +------ .../Exchange/CSV/Services/CSVImporter.php | 8 +------- .../Exchange/CSV/Services/CSVWriter.php | 3 +-- .../CSV/Services/CSVWriterInterface.php | 3 +-- src/Bundles/Exchange/ExchangeFactory.php | 6 ++---- src/Bundles/Exchange/ExchangeFormat.php | 3 +-- src/Bundles/Exchange/ExchangeInterface.php | 3 +-- src/Bundles/Exchange/HTML/HTMLExchange.php | 7 +++---- .../Exchange/HTML/Services/HTMLExporter.php | 13 ++---------- .../Exchange/HTML/Services/HTMLImporter.php | 5 +---- src/Bundles/Exchange/ImportEntry.php | 1 - src/Bundles/Exchange/ImportResult.php | 1 - src/Bundles/Storage/INI/IniStorage.php | 6 +----- src/Bundles/Storage/JSON/JsonStorage.php | 3 +-- .../Storage/JSON/Services/JsonLoader.php | 5 +---- .../Storage/JSON/Services/JsonSaver.php | 2 -- src/Bundles/Storage/PHP/PhpStorage.php | 3 --- .../Storage/PHP/Services/PHPLoader.php | 5 +---- src/Bundles/Storage/PHP/Services/PHPSaver.php | 5 +---- src/Bundles/Storage/PO/Models/Block.php | 6 +----- src/Bundles/Storage/PO/PoStorage.php | 13 +----------- .../Exception/SnippetNotFoundException.php | 4 ++-- .../Storage/Shopware6/Models/Snippet.php | 1 - .../Storage/Shopware6/Models/SnippetSet.php | 1 - .../Storage/Shopware6/Models/Sw6Locale.php | 1 - .../Storage/Shopware6/Models/UpdateField.php | 1 - .../Shopware6/Repository/EntityRepository.php | 2 -- .../EntityTranslationRepository.php | 7 ++----- .../Repository/LanguageRepository.php | 3 --- .../Repository/SnippetRepository.php | 17 ++++++---------- .../Shopware6/Service/TranslationLoader.php | 10 ++-------- .../Shopware6/Service/TranslationSaver.php | 10 +--------- .../Storage/Shopware6/Service/Uuid.php | 6 +++--- .../Storage/Shopware6/Shopware6Storage.php | 7 +++---- src/Bundles/Storage/StorageFactory.php | 14 +++++-------- src/Bundles/Storage/StorageHierarchy.php | 1 - src/Bundles/Storage/StorageInterface.php | 1 - src/Bundles/Storage/StorageSaveResult.php | 1 - .../Storage/YAML/Services/YamlSaver.php | 1 - src/Bundles/Storage/YAML/YamlStorage.php | 1 - .../Translator/DeepL/DeeplTranslator.php | 7 +++---- .../GoogleCloud/GoogleCloudTranslator.php | 5 ++--- .../GoogleWeb/GoogleWebTranslator.php | 6 ++---- .../Translator/OpenAI/OpenAITranslator.php | 5 ++--- src/Bundles/Translator/TranslatorFactory.php | 6 ++---- .../Translator/TranslatorInterface.php | 1 - src/Commands/Core/FixStructureCommand.php | 8 +------- src/Commands/Core/ListTranslationsCommand.php | 7 ++----- src/Commands/Core/MigrateCommand.php | 5 +---- src/Commands/Core/StatusCommand.php | 7 ++----- src/Commands/Core/ValidateCommand.php | 8 +------- src/Commands/Exchange/ExportCommand.php | 4 +--- src/Commands/Exchange/ImportCommand.php | 9 ++------- src/Commands/Translation/TranslateCommand.php | 10 ++-------- .../Configuration/ConfigurationLoader.php | 19 +++++------------- src/Components/Filter/FilterHandler.php | 3 --- src/Components/Reporter/JSON/JsonReporter.php | 2 -- .../Reporter/JUnit/JUnitReporter.php | 5 ----- .../Reporter/Model/ReportResult.php | 3 +-- src/Components/Reporter/Model/SuiteResult.php | 3 +-- src/Components/Reporter/Model/TestResult.php | 3 +-- src/Components/Reporter/ReporterFactory.php | 5 +---- src/Components/Reporter/ReporterInterface.php | 3 +-- .../CaseStyle/CaseStyleValidatorFactory.php | 4 +--- .../CaseStyle/CaseStyleValidatorInterface.php | 3 +-- .../Exception/CaseStyleNotFoundException.php | 4 ++-- .../CaseStyle/Style/CamelCaseValidator.php | 4 +--- .../CaseStyle/Style/KebabCaseValidator.php | 4 +--- .../CaseStyle/Style/LowerCaseValidator.php | 4 +--- .../CaseStyle/Style/NumberCaseValidator.php | 3 +-- .../CaseStyle/Style/PascalCaseValidator.php | 4 +--- .../CaseStyle/Style/SnakeCaseValidator.php | 4 +--- .../CaseStyle/Style/StartCaseValidator.php | 4 +--- .../CaseStyle/Style/UpperCaseValidator.php | 4 +--- .../Validator/CaseStyleValidator.php | 8 ++------ .../Validator/EmptyContentValidator.php | 2 -- .../Validator/MissingStructureValidator.php | 3 --- .../Validator/Model/ValidationResult.php | 1 - .../Validator/Model/ValidationTest.php | 3 +-- .../Validator/Rules/DisallowedTextsRule.php | 3 --- .../Validator/Rules/DuplicateContentRule.php | 5 +---- .../Validator/Rules/MaxKeyLengthRule.php | 5 +---- .../Validator/Rules/NestingDepthRule.php | 4 +--- .../Rules/RuleValidatorInterface.php | 3 +-- src/Components/Validator/RulesValidator.php | 3 --- .../Validator/ValidatorInterface.php | 1 - src/Exceptions/ConfigurationException.php | 4 ++-- .../TranslationNotFoundException.php | 4 ++-- src/Models/Command/CommandOption.php | 1 - src/Models/Configuration/Attribute.php | 1 - src/Models/Configuration/CaseStyle.php | 4 +--- src/Models/Configuration/Configuration.php | 2 -- src/Models/Configuration/Filter.php | 1 - src/Models/Configuration/Marker.php | 1 - src/Models/Configuration/Protection.php | 1 - src/Models/Configuration/Rule.php | 1 - src/Models/Configuration/Rules.php | 3 +-- src/Models/Translation/Locale.php | 5 +---- src/Models/Translation/Translation.php | 1 - src/Models/Translation/TranslationSet.php | 3 +-- src/PHPUnuhi.php | 1 - src/Services/Connection/ConnectionFactory.php | 1 - src/Services/Coverage/CoverageService.php | 4 ---- .../Coverage/Models/CoverageLocale.php | 2 -- src/Services/Coverage/Models/CoverageSet.php | 2 -- .../Coverage/Models/CoverageTotal.php | 4 ---- .../Coverage/Traits/CoverageDataTrait.php | 1 - src/Services/GroupName/GroupNameService.php | 2 -- src/Services/Maths/PercentageCalculator.php | 1 - src/Services/Placeholder/Placeholder.php | 1 - .../Placeholder/PlaceholderEncoder.php | 2 +- .../Placeholder/PlaceholderExtractor.php | 5 +---- src/Services/WordCounter/WordCounter.php | 3 +-- .../Writers/Directory/DirectoryWriter.php | 3 +-- .../Directory/DirectoryWriterInterface.php | 3 +-- src/Services/Writers/File/FileWriter.php | 1 - .../Writers/File/FileWriterInterface.php | 3 +-- src/Services/Writers/Xml/XmlWriter.php | 1 - .../Writers/Xml/XmlWriterInterface.php | 3 +-- src/Traits/ArrayTrait.php | 1 - src/Traits/BinaryTrait.php | 1 - src/Traits/CommandTrait.php | 1 - src/Traits/StringTrait.php | 1 - .../Bundles/Exchange/CSV/CSVExchangeTest.php | 1 - .../Bundles/Exchange/ExchangeFactoryTest.php | 9 ++++----- .../Bundles/Storage/StorageFactoryTest.php | 5 ++--- .../Translator/DeepL/DeepLTranslatorTest.php | 1 - .../Translator/TranslatorFactoryTest.php | 8 ++++---- .../Components/Filter/FilterHandlerTest.php | 2 +- .../Repoter/JSON/JsonReporterTest.php | 4 +--- .../Repoter/JUnit/JUnitReporterTest.php | 3 --- .../Repoter/Model/ReportResultTest.php | 3 +-- .../Repoter/Model/SuiteResultTest.php | 3 +-- .../Repoter/Model/TestResultTest.php | 3 +-- .../Repoter/ReporterFactoryTest.php | 9 ++++----- .../CaseStyleValidatorFactoryTest.php | 6 +++--- .../Style/CamelCaseValidatorTest.php | 1 - .../Style/KebabCaseValidatorTest.php | 1 - .../Style/LowerCaseValidatorTest.php | 1 - .../Style/NumberCaseValidatorTest.php | 1 - .../Style/PascalCaseValidatorTest.php | 1 - .../Style/SnakeCaseValidatorTest.php | 1 - .../Style/StartCaseValidatorTest.php | 1 - .../Style/UpperCaseValidatorTest.php | 1 - .../Validator/CaseStyleValidatorTest.php | 20 +++++++++---------- .../Validator/EmptyContentValidatorTest.php | 8 +++----- .../Validator/MixedStructureValidatorTest.php | 8 +++----- .../Validator/Model/ValidationErrorTest.php | 1 - .../Validator/Model/ValidationResultTest.php | 3 +-- .../Validator/Model/ValidationTestTest.php | 2 +- .../Rules/DisallowedTextsRuleTest.php | 8 +++----- .../Rules/DuplicateContentRuleTest.php | 10 ++++------ .../Validator/Rules/MaxKeyLengthRuleTest.php | 10 ++++------ .../Validator/Rules/NestingDepthRuleTest.php | 10 ++++------ .../Validator/RulesValidatorTest.php | 1 - .../Models/Command/CommandOptionTest.php | 3 +-- .../Models/Configuration/AttributeTest.php | 3 +-- .../Models/Configuration/CaseStyleTest.php | 1 - .../Configuration/ConfigurationTest.php | 1 - .../Models/Configuration/FilterTest.php | 3 +-- .../Models/Configuration/MarkerTest.php | 1 - .../Models/Configuration/ProtectionTest.php | 3 +-- .../phpunit/Models/Configuration/RuleTest.php | 1 - .../phpunit/Models/Translation/LocaleTest.php | 5 ++--- .../Models/Translation/TranslationSetTest.php | 11 +++++----- .../Models/Translation/TranslationTest.php | 1 - .../Connection/ConnectionFactoryTest.php | 3 +-- .../Services/Coverage/CoverageServiceTest.php | 3 +-- .../Coverage/Models/CoverageLocaleTest.php | 1 - .../Coverage/Models/CoverageSetTest.php | 1 - .../Coverage/Models/CoverageTotalTest.php | 1 - .../GroupName/GroupNameServiceTest.php | 3 +-- .../Maths/PercentageCalculatorTest.php | 1 - .../Placeholder/PlaceholderEncoderTest.php | 4 +--- .../Placeholder/PlaceholderExtractorTest.php | 1 - .../Services/Placeholder/PlaceholderTest.php | 1 - .../Services/WordCounter/WordCounterTest.php | 1 - tests/phpunit/Traits/ArrayTraitTest.php | 4 +--- tests/phpunit/Traits/BinaryTraitTest.php | 4 +--- tests/phpunit/Traits/StringTraitTest.php | 4 +--- tests/phpunit/Utils/Fakes/FakeCSVWriter.php | 3 +-- .../Utils/Fakes/FakeDirectoryWriter.php | 1 - .../Utils/Fakes/FakeExchangeFormat.php | 7 ++----- tests/phpunit/Utils/Fakes/FakeFileWriter.php | 3 +-- tests/phpunit/Utils/Fakes/FakeStorage.php | 3 +-- tests/phpunit/Utils/Fakes/FakeTranslator.php | 3 +-- tests/phpunit/Utils/Fakes/FakeXmlWriter.php | 1 - .../Utils/Traits/StringCleanerTrait.php | 2 +- .../Utils/Traits/TestReportBuilderTrait.php | 3 +-- .../Traits/TranslationSetBuilderTrait.php | 3 +-- 192 files changed, 197 insertions(+), 546 deletions(-) diff --git a/src/AppManager.php b/src/AppManager.php index e4c13fcc..b3c8454f 100755 --- a/src/AppManager.php +++ b/src/AppManager.php @@ -18,8 +18,8 @@ class AppManager /** * @param array $arguments - * @return void * @throws Exception + * @return void */ public static function run(array $arguments): void { @@ -38,5 +38,4 @@ public static function run(array $arguments): void $application->run(); } - } diff --git a/src/Bundles/Exchange/CSV/CSVExchange.php b/src/Bundles/Exchange/CSV/CSVExchange.php index c398e903..a7f89cdc 100644 --- a/src/Bundles/Exchange/CSV/CSVExchange.php +++ b/src/Bundles/Exchange/CSV/CSVExchange.php @@ -70,8 +70,8 @@ public function setOptionValues(array $options): void * @param TranslationSet $set * @param string $outputDir * @param bool $onlyEmpty - * @return void * @throws TranslationNotFoundException + * @return void */ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): void { @@ -81,13 +81,12 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): /** * @param string $filename - * @return ImportResult * @throws Exception + * @return ImportResult */ public function import(string $filename): ImportResult { $importer = new CSVImporter($this->csvDelimiter); return $importer->import($filename); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/CSV/Services/CSVExporter.php b/src/Bundles/Exchange/CSV/Services/CSVExporter.php index 49965230..e99e8abc 100644 --- a/src/Bundles/Exchange/CSV/Services/CSVExporter.php +++ b/src/Bundles/Exchange/CSV/Services/CSVExporter.php @@ -34,8 +34,8 @@ public function __construct(CSVWriterInterface $csvWriter, string $delimiter) * @param TranslationSet $set * @param string $outputDir * @param bool $onlyEmpty - * @return void * @throws TranslationNotFoundException + * @return void */ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): void { @@ -72,11 +72,9 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): # BUILD DATA LINES foreach ($set->getAllTranslationIDs() as $id) { - $keyRow = []; if ($onlyEmpty) { - $isComplete = $set->isCompletelyTranslated($id); # if it's already complete, do not export @@ -101,7 +99,6 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): # use the same sorting as our header line foreach ($sortedLanguagesColumns as $colName) { - foreach ($set->getLocales() as $locale) { # only use the one from our current column @@ -116,7 +113,6 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): $trans = $locale->findTranslation($id); $keyRow[] = $trans->getValue(); - } catch (TranslationNotFoundException $ex) { # if we have no translation, add an empty value $keyRow[] = ''; @@ -154,5 +150,4 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): echo ' [+] generated file: ' . $csvFilename . PHP_EOL . PHP_EOL; } - } diff --git a/src/Bundles/Exchange/CSV/Services/CSVImporter.php b/src/Bundles/Exchange/CSV/Services/CSVImporter.php index fac9c229..7f3bc79c 100644 --- a/src/Bundles/Exchange/CSV/Services/CSVImporter.php +++ b/src/Bundles/Exchange/CSV/Services/CSVImporter.php @@ -9,7 +9,6 @@ class CSVImporter { - use StringTrait; @@ -30,8 +29,8 @@ public function __construct(string $delimiter) /** * @param string $filename - * @return ImportResult * @throws Exception + * @return ImportResult */ public function import(string $filename): ImportResult { @@ -45,12 +44,10 @@ public function import(string $filename): ImportResult } while ($row = fgetcsv($csvFile, 0, $this->delimiter)) { - if ($headerFiles === []) { # header line $headerFiles = $row; } else { - $startIndex = 1; if (in_array('Group', $headerFiles)) { @@ -63,13 +60,11 @@ public function import(string $filename): ImportResult } for ($i = $startIndex; $i <= count($row) - 1; $i++) { - $value = $row[$i]; $localeExchangeID = (string)$headerFiles[$i]; if ($localeExchangeID !== '') { - $importData[] = new ImportEntry( $localeExchangeID, (string)$key, @@ -85,5 +80,4 @@ public function import(string $filename): ImportResult return new ImportResult($importData); } - } diff --git a/src/Bundles/Exchange/CSV/Services/CSVWriter.php b/src/Bundles/Exchange/CSV/Services/CSVWriter.php index 934ba702..ec865254 100644 --- a/src/Bundles/Exchange/CSV/Services/CSVWriter.php +++ b/src/Bundles/Exchange/CSV/Services/CSVWriter.php @@ -54,5 +54,4 @@ public function close($file): void { fclose($file); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/CSV/Services/CSVWriterInterface.php b/src/Bundles/Exchange/CSV/Services/CSVWriterInterface.php index 75d41683..5c278b5b 100644 --- a/src/Bundles/Exchange/CSV/Services/CSVWriterInterface.php +++ b/src/Bundles/Exchange/CSV/Services/CSVWriterInterface.php @@ -36,5 +36,4 @@ public function writeLine($file, array $row, string $delimiter): void; * @return void */ public function close($file): void; - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/ExchangeFactory.php b/src/Bundles/Exchange/ExchangeFactory.php index 28d7f577..921228b8 100644 --- a/src/Bundles/Exchange/ExchangeFactory.php +++ b/src/Bundles/Exchange/ExchangeFactory.php @@ -47,8 +47,8 @@ private function __construct() /** * @param ExchangeInterface $exchangeFormat - * @return void * @throws ConfigurationException + * @return void */ public function registerExchangeFormat(ExchangeInterface $exchangeFormat): void { @@ -94,8 +94,8 @@ public function getAllOptions(): array /** * @param string $format * @param array $options - * @return ExchangeInterface * @throws Exception + * @return ExchangeInterface */ public function getExchange(string $format, array $options): ExchangeInterface { @@ -104,7 +104,6 @@ public function getExchange(string $format, array $options): ExchangeInterface } foreach ($this->exchangeServices as $exchangeService) { - if ($exchangeService->getName() === $format) { $exchangeService->setOptionValues($options); @@ -114,5 +113,4 @@ public function getExchange(string $format, array $options): ExchangeInterface throw new Exception('No Exchange service found for format: ' . $format); } - } diff --git a/src/Bundles/Exchange/ExchangeFormat.php b/src/Bundles/Exchange/ExchangeFormat.php index 8f6acc0a..501d2238 100644 --- a/src/Bundles/Exchange/ExchangeFormat.php +++ b/src/Bundles/Exchange/ExchangeFormat.php @@ -14,5 +14,4 @@ class ExchangeFormat * */ public const HTML = 'html'; - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/ExchangeInterface.php b/src/Bundles/Exchange/ExchangeInterface.php index 669185e4..d25846d8 100644 --- a/src/Bundles/Exchange/ExchangeInterface.php +++ b/src/Bundles/Exchange/ExchangeInterface.php @@ -43,5 +43,4 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): * @return ImportResult */ public function import(string $filename): ImportResult; - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/HTML/HTMLExchange.php b/src/Bundles/Exchange/HTML/HTMLExchange.php index 3a08b75c..d4f1502b 100644 --- a/src/Bundles/Exchange/HTML/HTMLExchange.php +++ b/src/Bundles/Exchange/HTML/HTMLExchange.php @@ -43,8 +43,8 @@ public function setOptionValues(array $options): void * @param TranslationSet $set * @param string $outputDir * @param bool $onlyEmpty - * @return void * @throws TranslationNotFoundException + * @return void */ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): void { @@ -54,13 +54,12 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): /** * @param string $filename - * @return ImportResult * @throws Exception + * @return ImportResult */ public function import(string $filename): ImportResult { $importer = new HTMLImporter(); return $importer->import($filename); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/HTML/Services/HTMLExporter.php b/src/Bundles/Exchange/HTML/Services/HTMLExporter.php index d8ae4bbb..7521ea95 100644 --- a/src/Bundles/Exchange/HTML/Services/HTMLExporter.php +++ b/src/Bundles/Exchange/HTML/Services/HTMLExporter.php @@ -13,8 +13,8 @@ class HTMLExporter * @param TranslationSet $set * @param string $outputDir * @param bool $onlyEmpty - * @return void * @throws TranslationNotFoundException + * @return void */ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): void { @@ -87,10 +87,7 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): $previosuGroup = ''; foreach ($set->getAllTranslationIDs() as $id) { - - if ($onlyEmpty) { - $isComplete = $set->isCompletelyTranslated($id); # if it's already complete, do not export @@ -103,7 +100,6 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): foreach ($set->getLocales() as $locale) { - $translation = $locale->findTranslation($id); if ($set->hasGroups()) { @@ -122,8 +118,6 @@ public function export(TranslationSet $set, string $outputDir, bool $onlyEmpty): foreach ($set->getLocales() as $locale) { - - $value = $this->getTranslationValue($locale, $id); $value = htmlentities($value); @@ -168,7 +162,6 @@ class="translation textfield ' . $wasEmpty . '" file_put_contents($fullFile, $html); echo ' [+] generated file: ' . $fullFile . PHP_EOL . PHP_EOL; - } /** @@ -179,9 +172,7 @@ class="translation textfield ' . $wasEmpty . '" private function getTranslationValue(Locale $locale, string $key): string { foreach ($locale->getTranslations() as $translation) { - if ($translation->getID() === $key) { - return $translation->getValue(); } } @@ -333,4 +324,4 @@ function updateTextfieldStyle(input) { '; } -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/HTML/Services/HTMLImporter.php b/src/Bundles/Exchange/HTML/Services/HTMLImporter.php index 43476301..aa7017de 100644 --- a/src/Bundles/Exchange/HTML/Services/HTMLImporter.php +++ b/src/Bundles/Exchange/HTML/Services/HTMLImporter.php @@ -10,7 +10,6 @@ class HTMLImporter { - use StringTrait; /** @@ -24,7 +23,6 @@ public function import(string $filename): ImportResult $groupNameService = new GroupNameService(); foreach (new SplFileObject($filename) as $line) { - if ($line === false) { $line = ''; } @@ -63,5 +61,4 @@ public function import(string $filename): ImportResult return new ImportResult($foundData); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Exchange/ImportEntry.php b/src/Bundles/Exchange/ImportEntry.php index eee75176..8d7b9955 100644 --- a/src/Bundles/Exchange/ImportEntry.php +++ b/src/Bundles/Exchange/ImportEntry.php @@ -71,5 +71,4 @@ public function getValue(): string { return $this->value; } - } diff --git a/src/Bundles/Exchange/ImportResult.php b/src/Bundles/Exchange/ImportResult.php index aa165948..472210d7 100644 --- a/src/Bundles/Exchange/ImportResult.php +++ b/src/Bundles/Exchange/ImportResult.php @@ -26,5 +26,4 @@ public function getEntries(): array { return $this->entries; } - } diff --git a/src/Bundles/Storage/INI/IniStorage.php b/src/Bundles/Storage/INI/IniStorage.php index 7f7d51d2..37f8eb0e 100644 --- a/src/Bundles/Storage/INI/IniStorage.php +++ b/src/Bundles/Storage/INI/IniStorage.php @@ -69,13 +69,12 @@ public function configureStorage(TranslationSet $set): void /** * @param TranslationSet $set - * @return void * @throws Exception + * @return void */ public function loadTranslationSet(TranslationSet $set): void { foreach ($set->getLocales() as $locale) { - $iniArray = parse_ini_file($locale->getFilename(), true, INI_SCANNER_RAW); if ($iniArray === false) { @@ -83,7 +82,6 @@ public function loadTranslationSet(TranslationSet $set): void } foreach ($iniArray as $key => $value) { - if (is_array($value)) { # we have a section if ($key === $locale->getIniSection()) { @@ -91,7 +89,6 @@ public function loadTranslationSet(TranslationSet $set): void $locale->addTranslation($transKey, $transValue, ''); } } - } else { # we just have a plain value $locale->addTranslation($key, $value, ''); @@ -189,5 +186,4 @@ public function buildFileContentBuffer(Locale $locale, array &$contentBuffer, st return $translationCount; } - } diff --git a/src/Bundles/Storage/JSON/JsonStorage.php b/src/Bundles/Storage/JSON/JsonStorage.php index 87c327c0..0369dd7e 100644 --- a/src/Bundles/Storage/JSON/JsonStorage.php +++ b/src/Bundles/Storage/JSON/JsonStorage.php @@ -77,8 +77,8 @@ public function configureStorage(TranslationSet $set): void /** * @param TranslationSet $set - * @return void * @throws Exception + * @return void */ public function loadTranslationSet(TranslationSet $set): void { @@ -122,5 +122,4 @@ public function saveTranslationLocale(Locale $locale, string $filename): Storage return new StorageSaveResult(1, $translationsCount); } - } diff --git a/src/Bundles/Storage/JSON/Services/JsonLoader.php b/src/Bundles/Storage/JSON/Services/JsonLoader.php index 32757108..782d7a27 100644 --- a/src/Bundles/Storage/JSON/Services/JsonLoader.php +++ b/src/Bundles/Storage/JSON/Services/JsonLoader.php @@ -5,10 +5,8 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Traits\ArrayTrait; - class JsonLoader { - use ArrayTrait; @@ -46,5 +44,4 @@ public function loadTranslations(Locale $locale, string $delimiter): void $this->getLineNumbers($foundTranslations, $delimiter, '', 1, true) ); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/JSON/Services/JsonSaver.php b/src/Bundles/Storage/JSON/Services/JsonSaver.php index 1f723658..45a7210d 100644 --- a/src/Bundles/Storage/JSON/Services/JsonSaver.php +++ b/src/Bundles/Storage/JSON/Services/JsonSaver.php @@ -7,7 +7,6 @@ class JsonSaver { - use ArrayTrait; @@ -83,5 +82,4 @@ function (array $m) use ($indentStr): string { return $translationCount; } - } diff --git a/src/Bundles/Storage/PHP/PhpStorage.php b/src/Bundles/Storage/PHP/PhpStorage.php index 9871b211..f8cef138 100644 --- a/src/Bundles/Storage/PHP/PhpStorage.php +++ b/src/Bundles/Storage/PHP/PhpStorage.php @@ -13,7 +13,6 @@ class PhpStorage implements StorageInterface { - use ArrayTrait; /** @@ -111,7 +110,6 @@ public function saveTranslationSet(TranslationSet $set): StorageSaveResult $translationCount = 0; foreach ($set->getLocales() as $locale) { - $filename = $locale->getFilename(); $translationCount += $this->saver->saveLocale( @@ -143,5 +141,4 @@ public function saveTranslationLocale(Locale $locale, string $filename): Storage return new StorageSaveResult(1, $translationCount); } - } diff --git a/src/Bundles/Storage/PHP/Services/PHPLoader.php b/src/Bundles/Storage/PHP/Services/PHPLoader.php index 9ee58ed2..fdb3cc3b 100644 --- a/src/Bundles/Storage/PHP/Services/PHPLoader.php +++ b/src/Bundles/Storage/PHP/Services/PHPLoader.php @@ -7,7 +7,6 @@ class PHPLoader { - use ArrayTrait; /** @@ -18,7 +17,6 @@ class PHPLoader public function loadTranslationSet(TranslationSet $set, string $delimiter): void { foreach ($set->getLocales() as $locale) { - $arrayData = require($locale->getFilename()); if (!is_array($arrayData)) { @@ -37,5 +35,4 @@ public function loadTranslationSet(TranslationSet $set, string $delimiter): void ); } } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/PHP/Services/PHPSaver.php b/src/Bundles/Storage/PHP/Services/PHPSaver.php index daa0ca79..d21033ba 100644 --- a/src/Bundles/Storage/PHP/Services/PHPSaver.php +++ b/src/Bundles/Storage/PHP/Services/PHPSaver.php @@ -7,7 +7,6 @@ class PHPSaver { - use ArrayTrait; /** @@ -80,7 +79,6 @@ private function buildArray(array $root, int $indent): string foreach ($root as $key => $value) { - if (is_array($value)) { $indent += 1; @@ -94,5 +92,4 @@ private function buildArray(array $root, int $indent): string return $content; } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/PO/Models/Block.php b/src/Bundles/Storage/PO/Models/Block.php index 9d46f01b..99a554f6 100644 --- a/src/Bundles/Storage/PO/Models/Block.php +++ b/src/Bundles/Storage/PO/Models/Block.php @@ -36,7 +36,6 @@ public function getLines(): array public function getId(): string { foreach ($this->lines as $line) { - $isId = $this->stringDoesStartsWith($line, 'msgid'); if ($isId) { @@ -53,7 +52,6 @@ public function getId(): string public function getMessage(): string { foreach ($this->lines as $line) { - $isId = $this->stringDoesStartsWith($line, 'msgstr'); if ($isId) { @@ -71,7 +69,6 @@ public function getMessage(): string public function setMessage(string $msg): void { foreach ($this->lines as &$line) { - $isId = $this->stringDoesStartsWith($line, 'msgstr'); if ($isId) { @@ -93,5 +90,4 @@ private function getLineValue(string $line): string return str_replace('"', '', $msg); } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/PO/PoStorage.php b/src/Bundles/Storage/PO/PoStorage.php index 3de82ed5..0cb3e722 100644 --- a/src/Bundles/Storage/PO/PoStorage.php +++ b/src/Bundles/Storage/PO/PoStorage.php @@ -13,7 +13,6 @@ class PoStorage implements StorageInterface { - use StringTrait; @@ -69,18 +68,16 @@ public function configureStorage(TranslationSet $set): void /** * @param TranslationSet $set - * @return void * @throws Exception + * @return void */ public function loadTranslationSet(TranslationSet $set): void { foreach ($set->getLocales() as $locale) { - $lines = $this->getLines($locale->getFilename()); $blocks = $this->getBlocks($lines); foreach ($blocks as $block) { - $id = $block->getId(); $value = $block->getMessage(); @@ -111,7 +108,6 @@ public function saveTranslationSet(TranslationSet $set): StorageSaveResult } return new StorageSaveResult($localeCount, $translationCount); - } /** @@ -145,7 +141,6 @@ private function saveLocale(Locale $locale, array &$contentBuffer, string $filen $newLines = []; foreach ($blocks as $block) { - $id = $block->getId(); $existingKeys[] = $id; @@ -168,7 +163,6 @@ private function saveLocale(Locale $locale, array &$contentBuffer, string $filen $newLines[] = ''; foreach ($locale->getTranslations() as $translation) { - $found = false; foreach ($existingKeys as $existingKey) { @@ -211,13 +205,11 @@ private function clearLineBreaks(array $lines): array $newLines = []; $count = 0; foreach ($lines as $line) { - if (empty($line)) { if ($count <= 0) { $newLines[] = $line; $count += 1; } - } else { $newLines[] = $line; $count = 0; @@ -241,7 +233,6 @@ private function getLines(string $filename): array } while (($line = fgets($handle)) !== false) { - $line = trim($line); $lines[] = $line; } @@ -263,7 +254,6 @@ private function getBlocks(array $lines): array $currentBlockLines = []; foreach ($lines as $line) { - if (!empty($line) && !$inBlock) { # start new block $inBlock = true; @@ -276,7 +266,6 @@ private function getBlocks(array $lines): array } $currentBlockLines = []; } else { - $currentBlockLines[] = $line; } } diff --git a/src/Bundles/Storage/Shopware6/Exception/SnippetNotFoundException.php b/src/Bundles/Storage/Shopware6/Exception/SnippetNotFoundException.php index ee882c56..51dd9658 100644 --- a/src/Bundles/Storage/Shopware6/Exception/SnippetNotFoundException.php +++ b/src/Bundles/Storage/Shopware6/Exception/SnippetNotFoundException.php @@ -3,7 +3,7 @@ namespace PHPUnuhi\Bundles\Storage\Shopware6\Exception; use Exception; + class SnippetNotFoundException extends Exception { - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/Shopware6/Models/Snippet.php b/src/Bundles/Storage/Shopware6/Models/Snippet.php index 906f8589..7af04aec 100644 --- a/src/Bundles/Storage/Shopware6/Models/Snippet.php +++ b/src/Bundles/Storage/Shopware6/Models/Snippet.php @@ -101,5 +101,4 @@ public function getCustomFields(): string { return $this->customFields; } - } diff --git a/src/Bundles/Storage/Shopware6/Models/SnippetSet.php b/src/Bundles/Storage/Shopware6/Models/SnippetSet.php index 914f4dfb..40ef8150 100644 --- a/src/Bundles/Storage/Shopware6/Models/SnippetSet.php +++ b/src/Bundles/Storage/Shopware6/Models/SnippetSet.php @@ -55,5 +55,4 @@ public function getIso(): string { return $this->iso; } - } diff --git a/src/Bundles/Storage/Shopware6/Models/Sw6Locale.php b/src/Bundles/Storage/Shopware6/Models/Sw6Locale.php index 6ee91525..23e4b95c 100644 --- a/src/Bundles/Storage/Shopware6/Models/Sw6Locale.php +++ b/src/Bundles/Storage/Shopware6/Models/Sw6Locale.php @@ -55,5 +55,4 @@ public function getLocaleName(): string { return $this->localeName; } - } diff --git a/src/Bundles/Storage/Shopware6/Models/UpdateField.php b/src/Bundles/Storage/Shopware6/Models/UpdateField.php index 7b3c82ea..3b27eb2a 100644 --- a/src/Bundles/Storage/Shopware6/Models/UpdateField.php +++ b/src/Bundles/Storage/Shopware6/Models/UpdateField.php @@ -40,5 +40,4 @@ public function getValue(): string { return $this->value; } - } diff --git a/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php b/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php index 9fd853d5..08866a9f 100644 --- a/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php @@ -7,7 +7,6 @@ class EntityRepository { - use BinaryTrait; /** @@ -40,5 +39,4 @@ public function getEntity(string $entity, string $id): array return $stmt->fetch(PDO::FETCH_ASSOC); } - } diff --git a/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php b/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php index ca0d7d3f..3c41327d 100644 --- a/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php @@ -8,7 +8,6 @@ class EntityTranslationRepository { - use BinaryTrait; /** @@ -48,7 +47,7 @@ public function getTranslations(string $entity): array * @param string $entity * @param string $entityId * @param string $languageId - * @return array|null + * @return null|array */ public function getTranslationRow(string $entity, string $entityId, string $languageId): ?array { @@ -93,7 +92,6 @@ public function updateTranslationRow(string $entity, string $entityId, string $l # unfortunately, we have to assign NULL for every empty JSON field-value. # otherwise we get a JSON empty-document error foreach ($fieldValues as $data) { - $valueKey = 'value_' . $data->getField(); $value = $data->getValue(); @@ -101,7 +99,7 @@ public function updateTranslationRow(string $entity, string $entityId, string $l # make sure empty JSON fields are NULL if ($value === '' && in_array($data->getField(), $jsonFields)) { - $value = NULL; + $value = null; } $sqlFieldParts[] = $data->getField() . '= :' . $valueKey; @@ -140,5 +138,4 @@ private function getJsonFields(string $table): array return $jsonFields; } - } diff --git a/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php b/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php index 5d74e7a6..8d7caf44 100644 --- a/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php @@ -8,7 +8,6 @@ class LanguageRepository { - use BinaryTrait; /** @@ -42,7 +41,6 @@ public function getLanguages(): array } foreach ($dbRows as $row) { - $list[] = new Sw6Locale( $this->binaryToString((string)$row['langId']), (string)$row['langName'], @@ -52,5 +50,4 @@ public function getLanguages(): array return $list; } - } diff --git a/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php b/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php index 885a1be4..cc288723 100644 --- a/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php @@ -13,7 +13,6 @@ class SnippetRepository { - use BinaryTrait; /** @@ -32,8 +31,8 @@ public function __construct(PDO $pdo) /** - * @return SnippetSet[] * @throws Exception + * @return SnippetSet[] */ public function getSnippetSets(): array { @@ -50,7 +49,6 @@ public function getSnippetSets(): array $list = []; foreach ($dbRows as $row) { - $list[] = new SnippetSet( $this->binaryToString((string)$row['id']), (string)$row['name'], @@ -62,8 +60,8 @@ public function getSnippetSets(): array } /** - * @return Snippet[] * @throws Exception + * @return Snippet[] */ public function getSnippets(): array { @@ -89,8 +87,8 @@ public function getSnippets(): array /** * @param string $key * @param string $snippetSetId - * @return Snippet * @throws SnippetNotFoundException + * @return Snippet */ public function getSnippet(string $key, string $snippetSetId): Snippet { @@ -112,8 +110,8 @@ public function getSnippet(string $key, string $snippetSetId): Snippet /** * @param string $key - * @return Snippet * @throws SnippetNotFoundException + * @return Snippet */ public function getSnippetByKey(string $key): Snippet { @@ -156,8 +154,8 @@ public function updateSnippet(string $key, string $snippetSetId, string $value): * @param string $value * @param string $author * @param string $customFields - * @return void * @throws Exception + * @return void */ public function insertSnippet(string $key, string $snippetSetId, string $value, string $author, string $customFields): void { @@ -199,8 +197,5 @@ private function toEntity(array $row): Snippet (string)$row['author'], (string)$row['custom_fields'] ); - } - - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/Shopware6/Service/TranslationLoader.php b/src/Bundles/Storage/Shopware6/Service/TranslationLoader.php index da1c4ff3..dce172b2 100644 --- a/src/Bundles/Storage/Shopware6/Service/TranslationLoader.php +++ b/src/Bundles/Storage/Shopware6/Service/TranslationLoader.php @@ -17,7 +17,6 @@ class TranslationLoader { - use BinaryTrait; use StringTrait; @@ -51,8 +50,8 @@ public function __construct(PDO $pdo) /** * @param TranslationSet $set - * @return void * @throws ConfigurationException + * @return void */ public function loadTranslations(TranslationSet $set): void { @@ -80,9 +79,7 @@ private function loadSnippets(TranslationSet $set): void $allSnippetSets = $this->repoSnippets->getSnippetSets(); foreach ($set->getLocales() as $locale) { - foreach ($allSnippets as $snippet) { - $foundSet = null; foreach ($allSnippetSets as $snippetSet) { if ($snippetSet->getId() === $snippet->getSnippetSetId()) { @@ -106,7 +103,6 @@ private function loadSnippets(TranslationSet $set): void ); } } - } /** @@ -122,7 +118,6 @@ private function loadEntities(string $entity, TranslationSet $set): void $allDbTranslations = $this->repoEntityTranslations->getTranslations($entity); foreach ($set->getLocales() as $locale) { - $currentLanguageID = $this->getShopwareLanguageId($locale, $allDbLanguages); if ($currentLanguageID === '' || $currentLanguageID === '0') { @@ -190,5 +185,4 @@ private function getShopwareLanguageId(Locale $locale, array $allLanguages): str return ''; } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/Shopware6/Service/TranslationSaver.php b/src/Bundles/Storage/Shopware6/Service/TranslationSaver.php index 3d51dc5b..87a7beaa 100644 --- a/src/Bundles/Storage/Shopware6/Service/TranslationSaver.php +++ b/src/Bundles/Storage/Shopware6/Service/TranslationSaver.php @@ -20,7 +20,6 @@ class TranslationSaver { - use BinaryTrait; use StringTrait; @@ -52,8 +51,8 @@ public function __construct(PDO $pdo) /** * @param TranslationSet $set - * @return StorageSaveResult * @throws ConfigurationException + * @return StorageSaveResult */ public function saveTranslations(TranslationSet $set): StorageSaveResult { @@ -84,7 +83,6 @@ private function saveSnippets(TranslationSet $set): StorageSaveResult $allSnippetSets = $this->repoSnippets->getSnippetSets(); foreach ($set->getLocales() as $locale) { - $localeCount++; $foundSnippetSet = null; @@ -101,9 +99,7 @@ private function saveSnippets(TranslationSet $set): StorageSaveResult } foreach ($locale->getTranslations() as $translation) { - try { - $existingSnippet = $this->repoSnippets->getSnippet($translation->getKey(), $foundSnippetSet->getId()); $this->repoSnippets->updateSnippet( @@ -112,7 +108,6 @@ private function saveSnippets(TranslationSet $set): StorageSaveResult $translation->getValue() ); } catch (SnippetNotFoundException $ex) { - $existingSnippet = $this->repoSnippets->getSnippetByKey($translation->getKey()); $this->repoSnippets->insertSnippet( @@ -148,7 +143,6 @@ private function saveEntities(string $entity, TranslationSet $set): StorageSaveR $translationCount = 0; foreach ($set->getLocales() as $locale) { - $currentLanguageID = $this->getShopwareLanguageId($locale, $allDbLanguages); if ($currentLanguageID === '' || $currentLanguageID === '0') { @@ -168,7 +162,6 @@ private function saveEntities(string $entity, TranslationSet $set): StorageSaveR # now that we have grouped them, # build a single SQL update statement for every entity (group) foreach ($entityUpdateData as $group => $translations) { - $fields = []; $entityId = ''; @@ -220,5 +213,4 @@ private function getShopwareLanguageId(Locale $locale, array $allLanguages): str return ''; } - } diff --git a/src/Bundles/Storage/Shopware6/Service/Uuid.php b/src/Bundles/Storage/Shopware6/Service/Uuid.php index 3ce8f2f1..7162824d 100644 --- a/src/Bundles/Storage/Shopware6/Service/Uuid.php +++ b/src/Bundles/Storage/Shopware6/Service/Uuid.php @@ -3,13 +3,14 @@ namespace PHPUnuhi\Bundles\Storage\Shopware6\Service; use Exception; + class Uuid { /** - * @return string * @throws Exception + * @return string */ public static function randomHex(): string { @@ -59,5 +60,4 @@ private static function applyVariant(int $clockSeqHi): int return $clockSeqHi | 0x80; } - -} \ No newline at end of file +} diff --git a/src/Bundles/Storage/Shopware6/Shopware6Storage.php b/src/Bundles/Storage/Shopware6/Shopware6Storage.php index d5b0537f..acf64691 100644 --- a/src/Bundles/Storage/Shopware6/Shopware6Storage.php +++ b/src/Bundles/Storage/Shopware6/Shopware6Storage.php @@ -82,8 +82,8 @@ public function configureStorage(TranslationSet $set): void /** * @param TranslationSet $set - * @return void * @throws ConfigurationException + * @return void */ public function loadTranslationSet(TranslationSet $set): void { @@ -92,8 +92,8 @@ public function loadTranslationSet(TranslationSet $set): void /** * @param TranslationSet $set - * @return StorageSaveResult * @throws ConfigurationException + * @return StorageSaveResult */ public function saveTranslationSet(TranslationSet $set): StorageSaveResult { @@ -103,12 +103,11 @@ public function saveTranslationSet(TranslationSet $set): StorageSaveResult /** * @param Locale $locale * @param string $filename - * @return StorageSaveResult * @throws Exception + * @return StorageSaveResult */ public function saveTranslationLocale(Locale $locale, string $filename): StorageSaveResult { throw new Exception('Not supported at the moment'); } - } diff --git a/src/Bundles/Storage/StorageFactory.php b/src/Bundles/Storage/StorageFactory.php index 23280caf..a8a3ebe2 100644 --- a/src/Bundles/Storage/StorageFactory.php +++ b/src/Bundles/Storage/StorageFactory.php @@ -12,7 +12,6 @@ use PHPUnuhi\Exceptions\ConfigurationException; use PHPUnuhi\Models\Translation\TranslationSet; - class StorageFactory { @@ -50,8 +49,8 @@ private function __construct() /** * @param StorageInterface $storage - * @return void * @throws ConfigurationException + * @return void */ public function registerStorage(StorageInterface $storage): void { @@ -86,8 +85,8 @@ public function resetStorages(): void /** * @param TranslationSet $set - * @return StorageInterface * @throws ConfigurationException + * @return StorageInterface */ public function getStorage(TranslationSet $set): StorageInterface { @@ -99,20 +98,18 @@ public function getStorage(TranslationSet $set): StorageInterface /** * @param string $name * @param TranslationSet $set - * @return StorageInterface * @throws ConfigurationException + * @return StorageInterface */ public function getStorageByFormat(string $name, TranslationSet $set): StorageInterface { if ($name === '' || $name === '0') { - - throw new Exception('No name provided for the Storage' ); + throw new Exception('No name provided for the Storage'); } foreach ($this->storages as $storage) { - if ($storage->getStorageName() === $name) { - $storage->configureStorage( $set); + $storage->configureStorage($set); return $storage; } @@ -120,5 +117,4 @@ public function getStorageByFormat(string $name, TranslationSet $set): StorageIn throw new ConfigurationException('No storage found for name: ' . $name); } - } diff --git a/src/Bundles/Storage/StorageHierarchy.php b/src/Bundles/Storage/StorageHierarchy.php index 0f4e727a..a426bafd 100644 --- a/src/Bundles/Storage/StorageHierarchy.php +++ b/src/Bundles/Storage/StorageHierarchy.php @@ -40,5 +40,4 @@ public function getDelimiter(): string { return $this->delimiter; } - } diff --git a/src/Bundles/Storage/StorageInterface.php b/src/Bundles/Storage/StorageInterface.php index 3665f226..63f3ef7d 100644 --- a/src/Bundles/Storage/StorageInterface.php +++ b/src/Bundles/Storage/StorageInterface.php @@ -72,5 +72,4 @@ public function saveTranslationSet(TranslationSet $set): StorageSaveResult; * @return StorageSaveResult */ public function saveTranslationLocale(Locale $locale, string $filename): StorageSaveResult; - } diff --git a/src/Bundles/Storage/StorageSaveResult.php b/src/Bundles/Storage/StorageSaveResult.php index 39a9c716..0d9ed36e 100644 --- a/src/Bundles/Storage/StorageSaveResult.php +++ b/src/Bundles/Storage/StorageSaveResult.php @@ -41,5 +41,4 @@ public function getSavedTranslations(): int { return $this->savedTranslations; } - } diff --git a/src/Bundles/Storage/YAML/Services/YamlSaver.php b/src/Bundles/Storage/YAML/Services/YamlSaver.php index b26cc04a..dfc163f6 100644 --- a/src/Bundles/Storage/YAML/Services/YamlSaver.php +++ b/src/Bundles/Storage/YAML/Services/YamlSaver.php @@ -51,7 +51,6 @@ public function saveTranslations(Locale $locale, string $delimiter, string $file $saveValues = []; foreach ($locale->getTranslations() as $translation) { - $saveValues[$translation->getID()] = $translation->getValue(); $translationCount++; } diff --git a/src/Bundles/Storage/YAML/YamlStorage.php b/src/Bundles/Storage/YAML/YamlStorage.php index ff3403a1..97ea7fc1 100644 --- a/src/Bundles/Storage/YAML/YamlStorage.php +++ b/src/Bundles/Storage/YAML/YamlStorage.php @@ -122,5 +122,4 @@ public function saveTranslationLocale(Locale $locale, string $filename): Storage return new StorageSaveResult(1, $translationCount); } - } diff --git a/src/Bundles/Translator/DeepL/DeeplTranslator.php b/src/Bundles/Translator/DeepL/DeeplTranslator.php index 8743ccda..83b4d757 100644 --- a/src/Bundles/Translator/DeepL/DeeplTranslator.php +++ b/src/Bundles/Translator/DeepL/DeeplTranslator.php @@ -63,8 +63,8 @@ public function getOptions(): array /** * @param array $options - * @return void * @throws Exception + * @return void */ public function setOptionValues(array $options): void { @@ -83,8 +83,8 @@ public function setOptionValues(array $options): void * @param string $sourceLocale * @param string $targetLocale * @param Placeholder[] $foundPlaceholders - * @return string * @throws Exception + * @return string */ public function translate(string $text, string $sourceLocale, string $targetLocale, array $foundPlaceholders): string { @@ -130,5 +130,4 @@ public function translate(string $text, string $sourceLocale, string $targetLoca return $result; } - -} \ No newline at end of file +} diff --git a/src/Bundles/Translator/GoogleCloud/GoogleCloudTranslator.php b/src/Bundles/Translator/GoogleCloud/GoogleCloudTranslator.php index a9c8d32e..02e516e0 100644 --- a/src/Bundles/Translator/GoogleCloud/GoogleCloudTranslator.php +++ b/src/Bundles/Translator/GoogleCloud/GoogleCloudTranslator.php @@ -42,8 +42,8 @@ public function getOptions(): array /** * @param array $options - * @return void * @throws Exception + * @return void */ public function setOptionValues(array $options): void { @@ -61,8 +61,8 @@ public function setOptionValues(array $options): void * @param string $sourceLocale * @param string $targetLocale * @param Placeholder[] $foundPlaceholders - * @return string * @throws Exception + * @return string */ public function translate(string $text, string $sourceLocale, string $targetLocale, array $foundPlaceholders): string { @@ -92,5 +92,4 @@ public function translate(string $text, string $sourceLocale, string $targetLoca return $result; } - } diff --git a/src/Bundles/Translator/GoogleWeb/GoogleWebTranslator.php b/src/Bundles/Translator/GoogleWeb/GoogleWebTranslator.php index f3252e69..6fa8bdbb 100644 --- a/src/Bundles/Translator/GoogleWeb/GoogleWebTranslator.php +++ b/src/Bundles/Translator/GoogleWeb/GoogleWebTranslator.php @@ -46,8 +46,8 @@ public function setOptionValues(array $options): void * @param string $sourceLocale * @param string $targetLocale * @param Placeholder[] $foundPlaceholders - * @return string * @throws Exception + * @return string */ public function translate(string $text, string $sourceLocale, string $targetLocale, array $foundPlaceholders): string { @@ -93,6 +93,4 @@ public function translate(string $text, string $sourceLocale, string $targetLoca return $result; } - - -} \ No newline at end of file +} diff --git a/src/Bundles/Translator/OpenAI/OpenAITranslator.php b/src/Bundles/Translator/OpenAI/OpenAITranslator.php index a6b582e4..3a71f927 100644 --- a/src/Bundles/Translator/OpenAI/OpenAITranslator.php +++ b/src/Bundles/Translator/OpenAI/OpenAITranslator.php @@ -39,8 +39,8 @@ public function getOptions(): array /** * @param array $options - * @return void * @throws Exception + * @return void */ public function setOptionValues(array $options): void { @@ -57,8 +57,8 @@ public function setOptionValues(array $options): void * @param string $sourceLocale * @param string $targetLocale * @param Placeholder[] $foundPlaceholders - * @return string * @throws Exception + * @return string */ public function translate(string $text, string $sourceLocale, string $targetLocale, array $foundPlaceholders): string { @@ -108,5 +108,4 @@ public function translate(string $text, string $sourceLocale, string $targetLoca return trim((string)$choices[0]['text']); } - } diff --git a/src/Bundles/Translator/TranslatorFactory.php b/src/Bundles/Translator/TranslatorFactory.php index 9d95d303..c0ebe983 100644 --- a/src/Bundles/Translator/TranslatorFactory.php +++ b/src/Bundles/Translator/TranslatorFactory.php @@ -48,8 +48,8 @@ private function __construct() /** * @param TranslatorInterface $translator - * @return void * @throws ConfigurationException + * @return void */ public function registerTranslator(TranslatorInterface $translator): void { @@ -97,8 +97,8 @@ public function getAllOptions(): array /** * @param string $service * @param array $options - * @return TranslatorInterface * @throws Exception + * @return TranslatorInterface */ public function fromService(string $service, array $options): TranslatorInterface { @@ -107,7 +107,6 @@ public function fromService(string $service, array $options): TranslatorInterfac } foreach ($this->translators as $translator) { - if ($translator->getName() === $service) { # configure our translator with the # provided option values @@ -119,5 +118,4 @@ public function fromService(string $service, array $options): TranslatorInterfac throw new Exception('No translator found with name: ' . $service); } - } diff --git a/src/Bundles/Translator/TranslatorInterface.php b/src/Bundles/Translator/TranslatorInterface.php index cde48df7..a14e2fac 100644 --- a/src/Bundles/Translator/TranslatorInterface.php +++ b/src/Bundles/Translator/TranslatorInterface.php @@ -39,5 +39,4 @@ public function setOptionValues(array $options); * @return string */ public function translate(string $text, string $sourceLocale, string $targetLocale, array $foundPlaceholders): string; - } diff --git a/src/Commands/Core/FixStructureCommand.php b/src/Commands/Core/FixStructureCommand.php index 2f8e1155..a22b0f07 100644 --- a/src/Commands/Core/FixStructureCommand.php +++ b/src/Commands/Core/FixStructureCommand.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Commands\Core; - use PHPUnuhi\Bundles\Storage\StorageFactory; use PHPUnuhi\Configuration\ConfigurationLoader; use PHPUnuhi\Exceptions\ConfigurationException; @@ -17,7 +16,6 @@ class FixStructureCommand extends Command { - use CommandTrait; /** @@ -37,8 +35,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -63,7 +61,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $groupNameService = new GroupNameService(); foreach ($config->getTranslationSets() as $set) { - if ($setName !== '' && $setName !== '0' && $setName !== $set->getName()) { continue; } @@ -71,12 +68,10 @@ public function execute(InputInterface $input, OutputInterface $output): int $io->section('Fixing Translation Set: ' . $set->getName()); foreach ($set->getAllTranslationIDs() as $currentID) { - foreach ($set->getLocales() as $locale) { try { $locale->findTranslation($currentID); } catch (TranslationNotFoundException $ex) { - $groupName = $groupNameService->getGroupID($currentID); $propertyKey = $groupNameService->getPropertyName($currentID); $io->writeln(' [+] create translation: [' . $locale->getName() . '] ' . $currentID); @@ -106,5 +101,4 @@ public function execute(InputInterface $input, OutputInterface $output): int $io->success($countCreated . ' translations have been created!'); return 0; } - } diff --git a/src/Commands/Core/ListTranslationsCommand.php b/src/Commands/Core/ListTranslationsCommand.php index e43cfd40..10ecb9c7 100644 --- a/src/Commands/Core/ListTranslationsCommand.php +++ b/src/Commands/Core/ListTranslationsCommand.php @@ -13,7 +13,6 @@ class ListTranslationsCommand extends Command { - use CommandTrait; /** @@ -32,8 +31,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -53,7 +52,6 @@ public function execute(InputInterface $input, OutputInterface $output): int foreach ($config->getTranslationSets() as $set) { - $io->section('Translation Set: ' . $set->getName()); foreach ($set->getAllTranslationIDs() as $id) { @@ -63,5 +61,4 @@ public function execute(InputInterface $input, OutputInterface $output): int return 0; } - -} \ No newline at end of file +} diff --git a/src/Commands/Core/MigrateCommand.php b/src/Commands/Core/MigrateCommand.php index 5b8da87f..f4d16c6a 100644 --- a/src/Commands/Core/MigrateCommand.php +++ b/src/Commands/Core/MigrateCommand.php @@ -16,7 +16,6 @@ class MigrateCommand extends Command { - use CommandTrait; /** @@ -36,8 +35,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -57,7 +56,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $config = $configLoader->load($configFile); foreach ($config->getTranslationSets() as $set) { - $io->section('Translation-Set: ' . $set->getName()); $sourceStorage = StorageFactory::getInstance()->getStorage($set); @@ -97,5 +95,4 @@ private function getNewLocaleFilename(Locale $locale, StorageInterface $targetSt return $newFile . ('.' . $targetStorage->getFileExtension()); } - } diff --git a/src/Commands/Core/StatusCommand.php b/src/Commands/Core/StatusCommand.php index b5e27671..9f339a5d 100644 --- a/src/Commands/Core/StatusCommand.php +++ b/src/Commands/Core/StatusCommand.php @@ -15,7 +15,6 @@ class StatusCommand extends Command { - use CommandTrait; /** @@ -35,8 +34,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -60,7 +59,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $coverageResult = $coverageService->getCoverage($config->getTranslationSets()); foreach ($coverageResult->getCoverageSets() as $translationSet) { - $io->section('Translation Set: ' . $translationSet->getName()); $io->writeln("Coverage: " . $translationSet->getCoverage() . '% (' . $translationSet->getCountTranslated() . '/' . $translationSet->getCountAll() . ')'); @@ -84,5 +82,4 @@ public function execute(InputInterface $input, OutputInterface $output): int return 0; } - -} \ No newline at end of file +} diff --git a/src/Commands/Core/ValidateCommand.php b/src/Commands/Core/ValidateCommand.php index 89574c0f..995341b8 100644 --- a/src/Commands/Core/ValidateCommand.php +++ b/src/Commands/Core/ValidateCommand.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Commands\Core; - use PHPUnuhi\Bundles\Storage\StorageFactory; use PHPUnuhi\Components\Reporter\Model\ReportResult; use PHPUnuhi\Components\Reporter\Model\SuiteResult; @@ -25,7 +24,6 @@ class ValidateCommand extends Command { - use CommandTrait; use StringTrait; @@ -48,9 +46,9 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws CaseStyleNotFoundException * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -85,7 +83,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $reportResult = new ReportResult(); foreach ($config->getTranslationSets() as $set) { - $io->section('Translation-Set: ' . $set->getName()); $io->writeln('-------------------------------------------------------------'); @@ -111,7 +108,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $suiteResult = new SuiteResult($set->getName()); foreach ($validators as $validator) { - $result = $validator->validate($set, $storage); if (!$result->isValid()) { @@ -153,7 +149,6 @@ public function execute(InputInterface $input, OutputInterface $output): int if ($reportFormat !== '' && $reportFormat !== '0') { - $reporter = ReporterFactory::getInstance()->getReporter($reportFormat); if ($reportFilename === '' || $reportFilename === '0') { @@ -176,5 +171,4 @@ public function execute(InputInterface $input, OutputInterface $output): int $io->error('Found ' . $errorCount . ' errors!'); return 1; } - } diff --git a/src/Commands/Exchange/ExportCommand.php b/src/Commands/Exchange/ExportCommand.php index 68396b4b..2788bf47 100644 --- a/src/Commands/Exchange/ExportCommand.php +++ b/src/Commands/Exchange/ExportCommand.php @@ -15,7 +15,6 @@ class ExportCommand extends Command { - use CommandTrait; @@ -47,8 +46,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -93,5 +92,4 @@ public function execute(InputInterface $input, OutputInterface $output): int $io->success('All translations exported!'); return 0; } - } diff --git a/src/Commands/Exchange/ImportCommand.php b/src/Commands/Exchange/ImportCommand.php index 56ebb426..2e559048 100644 --- a/src/Commands/Exchange/ImportCommand.php +++ b/src/Commands/Exchange/ImportCommand.php @@ -21,7 +21,6 @@ class ImportCommand extends Command { - use CommandTrait; @@ -52,8 +51,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -90,7 +89,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $filterHandler = new FilterHandler(); foreach ($config->getTranslationSets() as $set) { - if ($setName !== $set->getName()) { continue; } @@ -130,9 +128,7 @@ public function execute(InputInterface $input, OutputInterface $output): int private function updateTranslationSet(TranslationSet $set, ImportResult $importData): void { foreach ($importData->getEntries() as $entry) { - foreach ($set->getLocales() as $locale) { - if ($entry->getLocaleExchangeID() !== $locale->getExchangeIdentifier()) { continue; } @@ -149,5 +145,4 @@ private function updateTranslationSet(TranslationSet $set, ImportResult $importD } } } - -} +} diff --git a/src/Commands/Translation/TranslateCommand.php b/src/Commands/Translation/TranslateCommand.php index 530dd47b..8f2df3ab 100644 --- a/src/Commands/Translation/TranslateCommand.php +++ b/src/Commands/Translation/TranslateCommand.php @@ -18,7 +18,6 @@ class TranslateCommand extends Command { - use CommandTrait; @@ -58,8 +57,8 @@ protected function configure() /** * @param InputInterface $input * @param OutputInterface $output - * @return int * @throws ConfigurationException + * @return int */ public function execute(InputInterface $input, OutputInterface $output): int { @@ -96,7 +95,6 @@ public function execute(InputInterface $input, OutputInterface $output): int $translateFailedCount = 0; foreach ($config->getTranslationSets() as $set) { - $translatedInSet = 0; # if we have configured to only translate a specific set then skip others @@ -111,7 +109,6 @@ public function execute(InputInterface $input, OutputInterface $output): int # first iterate through ids # then we have all ids next to each other for better comparing on CLI foreach ($allIDs as $currentID) { - foreach ($set->getLocales() as $locale) { # if we have configured to only translate a specific locale then skip other locales @@ -129,7 +126,6 @@ public function execute(InputInterface $input, OutputInterface $output): int # translate if we either force it or only if our value is empty if ($forceLocale || $currentTranslation->isEmpty()) { - try { $existingData = $set->findAnyExistingTranslation($currentID, $sourceLocale); } catch (TranslationNotFoundException $ex) { @@ -211,6 +207,4 @@ public function execute(InputInterface $input, OutputInterface $output): int $io->success($translatedCount . ' translation(s) are updated!'); return 0; } - - -} \ No newline at end of file +} diff --git a/src/Components/Configuration/ConfigurationLoader.php b/src/Components/Configuration/ConfigurationLoader.php index b9c3d9e0..b4a611e9 100644 --- a/src/Components/Configuration/ConfigurationLoader.php +++ b/src/Components/Configuration/ConfigurationLoader.php @@ -17,7 +17,6 @@ use PHPUnuhi\Models\Translation\TranslationSet; use SimpleXMLElement; - class ConfigurationLoader { @@ -38,9 +37,9 @@ public function __construct() /** * @param string $rootConfigFilename - * @return Configuration * @throws ConfigurationException * @throws Exception + * @return Configuration */ public function load(string $rootConfigFilename): Configuration { @@ -64,7 +63,6 @@ public function load(string $rootConfigFilename): Configuration # now iterate through all our files and process # every file independently, because it might have some content in it foreach ($importFiles as $file) { - $fullFilename = $rootConfigDir . $file; $fileXmlString = (string)file_get_contents($fullFilename); @@ -145,8 +143,8 @@ private function loadImports(SimpleXMLElement $rootNode): array /** * @param SimpleXMLElement $rootNode * @param string $configFilename - * @return TranslationSet[] * @throws Exception + * @return TranslationSet[] */ private function loadTranslations(SimpleXMLElement $rootNode, string $configFilename): array { @@ -160,7 +158,6 @@ private function loadTranslations(SimpleXMLElement $rootNode, string $configFile /** @var SimpleXMLElement $xmlSet */ foreach ($rootNode->translations->children() as $xmlSet) { - $setName = trim((string)$xmlSet['name']); $nodeFormat = $xmlSet->format; $nodeProtection = $xmlSet->protect; @@ -223,7 +220,6 @@ private function loadTranslations(SimpleXMLElement $rootNode, string $configFile # this is because filters are also used in imports (at least affects imports) # which means that they would lead to removed keys on FILE-type storages. if (!$storage->supportsFilters() && $set->getFilter()->hasFilters()) { - throw new ConfigurationException('Filters are not allowed for storage format: ' . $setFormat); } @@ -245,8 +241,8 @@ private function loadTranslations(SimpleXMLElement $rootNode, string $configFile /** * @param SimpleXMLElement $rootFormat - * @return array * @throws Exception + * @return array */ private function parseFormat(SimpleXMLElement $rootFormat): array { @@ -260,7 +256,6 @@ private function parseFormat(SimpleXMLElement $rootFormat): array $setAttributes = ''; foreach ($children as $formatTag => $formatElement) { - if ($formatTag === '@attributes') { continue; } @@ -349,7 +344,6 @@ private function loadStyles(SimpleXMLElement $stylesNode): array } foreach ($stylesNode->style as $style) { - $attributes = $style->attributes(); $styleName = (string)$style; @@ -407,8 +401,8 @@ private function loadRules(SimpleXMLElement $rulesNode): array /** * @param SimpleXMLElement $rootLocales * @param string $configFilename - * @return array * @throws ConfigurationException + * @return array */ private function loadLocales(SimpleXMLElement $rootLocales, string $configFilename): array { @@ -418,7 +412,6 @@ private function loadLocales(SimpleXMLElement $rootLocales, string $configFilena $basePath = $this->getAttribute('basePath', $rootLocales); foreach ($rootLocales->children() as $nodeLocale) { - $nodeType = $nodeLocale->getName(); $innerValue = trim((string)$nodeLocale[0]); @@ -465,15 +458,14 @@ private function loadLocales(SimpleXMLElement $rootLocales, string $configFilena /** * @param Configuration $configuration - * @return void * @throws Exception + * @return void */ private function validateConfig(Configuration $configuration): void { $foundSets = []; foreach ($configuration->getTranslationSets() as $set) { - if ($set->getName() === '') { throw new ConfigurationException('TranslationSet has no name. This is required!'); } @@ -492,7 +484,6 @@ private function validateConfig(Configuration $configuration): void $foundLocales = []; foreach ($set->getLocales() as $locale) { - if ($locale->getName() === '') { throw new ConfigurationException('Locale has no name. This is required!'); } diff --git a/src/Components/Filter/FilterHandler.php b/src/Components/Filter/FilterHandler.php index 58b877b4..f5934932 100644 --- a/src/Components/Filter/FilterHandler.php +++ b/src/Components/Filter/FilterHandler.php @@ -16,16 +16,13 @@ public function applyFilter(TranslationSet $set): void $filter = $set->getFilter(); foreach ($set->getLocales() as $locale) { - $translations = $locale->getTranslations(); foreach ($translations as $translation) { - if (!$filter->isKeyAllowed($translation->getKey())) { $locale->removeTranslation($translation->getID()); } } } } - } diff --git a/src/Components/Reporter/JSON/JsonReporter.php b/src/Components/Reporter/JSON/JsonReporter.php index a3fbbf93..a1f69b0a 100644 --- a/src/Components/Reporter/JSON/JsonReporter.php +++ b/src/Components/Reporter/JSON/JsonReporter.php @@ -60,7 +60,6 @@ public function generate(string $filename, ReportResult $report): void ]; foreach ($report->getSuites() as $suite) { - $suiteJson = [ 'name' => $suite->getName(), 'tests' => $suite->getTestCount(), @@ -104,5 +103,4 @@ public function generate(string $filename, ReportResult $report): void $this->fileWriter->writeFile($filename, (string)$json); } - } diff --git a/src/Components/Reporter/JUnit/JUnitReporter.php b/src/Components/Reporter/JUnit/JUnitReporter.php index a93aafd4..e06afdaf 100644 --- a/src/Components/Reporter/JUnit/JUnitReporter.php +++ b/src/Components/Reporter/JUnit/JUnitReporter.php @@ -7,7 +7,6 @@ use PHPUnuhi\Services\Writers\Directory\DirectoryWriterInterface; use PHPUnuhi\Services\Writers\Xml\XmlWriterInterface; - class JUnitReporter implements ReporterInterface { @@ -62,11 +61,9 @@ public function generate(string $filename, ReportResult $report): void foreach ($report->getSuites() as $suite) { - $content .= ''; foreach ($suite->getTests() as $test) { - $content .= ''; if (!$test->isSuccess()) { @@ -93,6 +90,4 @@ public function generate(string $filename, ReportResult $report): void $this->xmlWriter->saveXml($filename, $content); } - - } diff --git a/src/Components/Reporter/Model/ReportResult.php b/src/Components/Reporter/Model/ReportResult.php index d0362551..7c5e40f8 100644 --- a/src/Components/Reporter/Model/ReportResult.php +++ b/src/Components/Reporter/Model/ReportResult.php @@ -53,5 +53,4 @@ public function getFailureCount(): int return $count; } - -} \ No newline at end of file +} diff --git a/src/Components/Reporter/Model/SuiteResult.php b/src/Components/Reporter/Model/SuiteResult.php index 086413f0..5ed957e4 100644 --- a/src/Components/Reporter/Model/SuiteResult.php +++ b/src/Components/Reporter/Model/SuiteResult.php @@ -70,5 +70,4 @@ public function getFailureCount(): int return $count; } - -} \ No newline at end of file +} diff --git a/src/Components/Reporter/Model/TestResult.php b/src/Components/Reporter/Model/TestResult.php index 44ae64d4..cf8ca3df 100644 --- a/src/Components/Reporter/Model/TestResult.php +++ b/src/Components/Reporter/Model/TestResult.php @@ -123,5 +123,4 @@ public function isSuccess(): bool { return $this->success; } - -} \ No newline at end of file +} diff --git a/src/Components/Reporter/ReporterFactory.php b/src/Components/Reporter/ReporterFactory.php index d27d0b60..f9cfe206 100644 --- a/src/Components/Reporter/ReporterFactory.php +++ b/src/Components/Reporter/ReporterFactory.php @@ -61,18 +61,16 @@ public function resetStorages(): void /** * @param string $name - * @return ReporterInterface * @throws ConfigurationException + * @return ReporterInterface */ public function getReporter(string $name): ReporterInterface { if ($name === '' || $name === '0') { - throw new InvalidArgumentException('No name provided for the Reporter'); } foreach ($this->reporters as $reporter) { - if ($reporter->getName() === $name) { return $reporter; } @@ -80,5 +78,4 @@ public function getReporter(string $name): ReporterInterface throw new ConfigurationException('No reporter found for name: ' . $name); } - } diff --git a/src/Components/Reporter/ReporterInterface.php b/src/Components/Reporter/ReporterInterface.php index 815d60f2..c9d65c73 100644 --- a/src/Components/Reporter/ReporterInterface.php +++ b/src/Components/Reporter/ReporterInterface.php @@ -23,5 +23,4 @@ public function getDefaultFilename(): string; * @return void */ public function generate(string $filename, ReportResult $report): void; - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/CaseStyleValidatorFactory.php b/src/Components/Validator/CaseStyle/CaseStyleValidatorFactory.php index e40549de..9bbe4348 100644 --- a/src/Components/Validator/CaseStyle/CaseStyleValidatorFactory.php +++ b/src/Components/Validator/CaseStyle/CaseStyleValidatorFactory.php @@ -38,13 +38,12 @@ public function __construct() /** * @param string $identifier - * @return CaseStyleValidatorInterface * @throws CaseStyleNotFoundException + * @return CaseStyleValidatorInterface */ public function fromIdentifier(string $identifier): CaseStyleValidatorInterface { foreach ($this->validators as $validator) { - if ($validator->getIdentifier() === $identifier) { return $validator; } @@ -52,5 +51,4 @@ public function fromIdentifier(string $identifier): CaseStyleValidatorInterface throw new CaseStyleNotFoundException('No CaseStyle validator found for identifier: ' . $identifier); } - } diff --git a/src/Components/Validator/CaseStyle/CaseStyleValidatorInterface.php b/src/Components/Validator/CaseStyle/CaseStyleValidatorInterface.php index 89c58f1a..2787076c 100644 --- a/src/Components/Validator/CaseStyle/CaseStyleValidatorInterface.php +++ b/src/Components/Validator/CaseStyle/CaseStyleValidatorInterface.php @@ -15,5 +15,4 @@ public function getIdentifier():string; * @return bool */ public function isValid(string $text): bool; - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Exception/CaseStyleNotFoundException.php b/src/Components/Validator/CaseStyle/Exception/CaseStyleNotFoundException.php index fa3e0757..2fb59f15 100644 --- a/src/Components/Validator/CaseStyle/Exception/CaseStyleNotFoundException.php +++ b/src/Components/Validator/CaseStyle/Exception/CaseStyleNotFoundException.php @@ -3,7 +3,7 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Exception; use Exception; + class CaseStyleNotFoundException extends Exception { - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/CamelCaseValidator.php b/src/Components/Validator/CaseStyle/Style/CamelCaseValidator.php index e441bb67..905d6bb2 100644 --- a/src/Components/Validator/CaseStyle/Style/CamelCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/CamelCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class CamelCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/KebabCaseValidator.php b/src/Components/Validator/CaseStyle/Style/KebabCaseValidator.php index f0262c00..6ca45503 100644 --- a/src/Components/Validator/CaseStyle/Style/KebabCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/KebabCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class KebabCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/LowerCaseValidator.php b/src/Components/Validator/CaseStyle/Style/LowerCaseValidator.php index d1b163a9..6352d663 100644 --- a/src/Components/Validator/CaseStyle/Style/LowerCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/LowerCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class LowerCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/NumberCaseValidator.php b/src/Components/Validator/CaseStyle/Style/NumberCaseValidator.php index e5ac769b..b988e887 100644 --- a/src/Components/Validator/CaseStyle/Style/NumberCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/NumberCaseValidator.php @@ -23,5 +23,4 @@ public function isValid(string $text): bool { return is_numeric($text); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/PascalCaseValidator.php b/src/Components/Validator/CaseStyle/Style/PascalCaseValidator.php index 3f30d0f5..8669ff8e 100644 --- a/src/Components/Validator/CaseStyle/Style/PascalCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/PascalCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class PascalCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/SnakeCaseValidator.php b/src/Components/Validator/CaseStyle/Style/SnakeCaseValidator.php index dcaedae6..c6872c26 100644 --- a/src/Components/Validator/CaseStyle/Style/SnakeCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/SnakeCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class SnakeCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/StartCaseValidator.php b/src/Components/Validator/CaseStyle/Style/StartCaseValidator.php index d6bde1ac..6faf4d07 100644 --- a/src/Components/Validator/CaseStyle/Style/StartCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/StartCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class StartCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyle/Style/UpperCaseValidator.php b/src/Components/Validator/CaseStyle/Style/UpperCaseValidator.php index 2fb98a5b..11dcdaaa 100644 --- a/src/Components/Validator/CaseStyle/Style/UpperCaseValidator.php +++ b/src/Components/Validator/CaseStyle/Style/UpperCaseValidator.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Components\Validator\CaseStyle\Style; - use PHPUnuhi\Components\Validator\CaseStyle\CaseStyleValidatorInterface; class UpperCaseValidator implements CaseStyleValidatorInterface @@ -28,5 +27,4 @@ public function isValid(string $text): bool return ($count > 0); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/CaseStyleValidator.php b/src/Components/Validator/CaseStyleValidator.php index 7108fd2f..e7478cdc 100644 --- a/src/Components/Validator/CaseStyleValidator.php +++ b/src/Components/Validator/CaseStyleValidator.php @@ -24,8 +24,8 @@ public function getTypeIdentifier(): string /** * @param TranslationSet $set * @param StorageInterface $storage - * @return ValidationResult * @throws CaseStyleNotFoundException + * @return ValidationResult */ public function validate(TranslationSet $set, StorageInterface $storage): ValidationResult { @@ -48,7 +48,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { foreach ($locale->getTranslations() as $translation) { - $isKeyCaseValid = true; $invalidKeyPart = ''; @@ -71,11 +70,9 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $partLevel = 0; foreach ($keyParts as $part) { - $invalidKeyPart = $part; foreach ($caseStyles as $caseStyle) { - if ($caseStyle->hasLevel() && $caseStyle->getLevel() !== $partLevel) { continue; } @@ -149,5 +146,4 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida return new ValidationResult($tests, $errors); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/EmptyContentValidator.php b/src/Components/Validator/EmptyContentValidator.php index 32a7527f..117a94b6 100644 --- a/src/Components/Validator/EmptyContentValidator.php +++ b/src/Components/Validator/EmptyContentValidator.php @@ -31,7 +31,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { foreach ($locale->getTranslations() as $translation) { - $testPassed = !$translation->isEmpty(); $tests[] = new ValidationTest( @@ -68,5 +67,4 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida return new ValidationResult($tests, $errors); } - } diff --git a/src/Components/Validator/MissingStructureValidator.php b/src/Components/Validator/MissingStructureValidator.php index 0684078c..9e34d05e 100644 --- a/src/Components/Validator/MissingStructureValidator.php +++ b/src/Components/Validator/MissingStructureValidator.php @@ -33,7 +33,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $errors = []; foreach ($set->getLocales() as $locale) { - $localeKeys = $locale->getTranslationIDs(); # verify if our current locale has the same structure @@ -44,7 +43,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $same = $this->getSame($localeKeys, $allKeys); if (!$structureValid) { - $filtered = $this->getDiff($localeKeys, $allKeys); foreach ($filtered as $key) { @@ -128,5 +126,4 @@ private function getSame(array $a, array $b): array return array_merge($diffA, $diffB); } - } diff --git a/src/Components/Validator/Model/ValidationResult.php b/src/Components/Validator/Model/ValidationResult.php index 8e872d80..06380828 100644 --- a/src/Components/Validator/Model/ValidationResult.php +++ b/src/Components/Validator/Model/ValidationResult.php @@ -50,5 +50,4 @@ public function getErrors(): array { return $this->errors; } - } diff --git a/src/Components/Validator/Model/ValidationTest.php b/src/Components/Validator/Model/ValidationTest.php index 73fb3563..759da305 100644 --- a/src/Components/Validator/Model/ValidationTest.php +++ b/src/Components/Validator/Model/ValidationTest.php @@ -127,5 +127,4 @@ public function isSuccess(): bool { return $this->success; } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/Rules/DisallowedTextsRule.php b/src/Components/Validator/Rules/DisallowedTextsRule.php index fe3001a4..adde072e 100644 --- a/src/Components/Validator/Rules/DisallowedTextsRule.php +++ b/src/Components/Validator/Rules/DisallowedTextsRule.php @@ -11,7 +11,6 @@ class DisallowedTextsRule implements RuleValidatorInterface { - use StringTrait; /** @@ -49,7 +48,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { foreach ($locale->getTranslations() as $translation) { - $foundWord = null; foreach ($this->disallowedWords as $disallowedWord) { if ($this->stringDoesContain($translation->getValue(), $disallowedWord)) { @@ -94,5 +92,4 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida return new ValidationResult($tests, $errors); } - } diff --git a/src/Components/Validator/Rules/DuplicateContentRule.php b/src/Components/Validator/Rules/DuplicateContentRule.php index 2651553a..d8836ac3 100644 --- a/src/Components/Validator/Rules/DuplicateContentRule.php +++ b/src/Components/Validator/Rules/DuplicateContentRule.php @@ -40,11 +40,9 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { - $existingValues = []; foreach ($locale->getTranslations() as $translation) { - $testPassed = false; if (!in_array($translation->getValue(), $existingValues, true)) { @@ -111,5 +109,4 @@ private function buildError(Locale $locale, string $identifier): ValidationError $locale->findLineNumber($identifier) ); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/Rules/MaxKeyLengthRule.php b/src/Components/Validator/Rules/MaxKeyLengthRule.php index 83866e59..f8e40ced 100644 --- a/src/Components/Validator/Rules/MaxKeyLengthRule.php +++ b/src/Components/Validator/Rules/MaxKeyLengthRule.php @@ -56,7 +56,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { foreach ($locale->getTranslations() as $translation) { - if ($hierarchy->isMultiLevel()) { $parts = explode($hierarchy->getDelimiter(), $translation->getKey()); if (!is_array($parts)) { @@ -68,7 +67,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $invalidKey = null; foreach ($parts as $part) { - if (strlen($part) > $this->maxKeyLength) { $invalidKey = $part; break; @@ -112,5 +110,4 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida return new ValidationResult($tests, $errors); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/Rules/NestingDepthRule.php b/src/Components/Validator/Rules/NestingDepthRule.php index f6ac9e7d..90652150 100644 --- a/src/Components/Validator/Rules/NestingDepthRule.php +++ b/src/Components/Validator/Rules/NestingDepthRule.php @@ -60,7 +60,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida foreach ($set->getLocales() as $locale) { foreach ($locale->getTranslations() as $translation) { - $parts = explode($hierarchy->getDelimiter(), $translation->getKey()); if (!is_array($parts)) { @@ -128,5 +127,4 @@ private function buildError(Locale $locale, string $identifier, int $depthOfKey) $locale->findLineNumber($identifier) ); } - -} \ No newline at end of file +} diff --git a/src/Components/Validator/Rules/RuleValidatorInterface.php b/src/Components/Validator/Rules/RuleValidatorInterface.php index f54d61d8..d7332304 100644 --- a/src/Components/Validator/Rules/RuleValidatorInterface.php +++ b/src/Components/Validator/Rules/RuleValidatorInterface.php @@ -20,5 +20,4 @@ public function getRuleIdentifier(): string; * @return ValidationResult */ public function validate(TranslationSet $set, StorageInterface $storage): ValidationResult; - -} \ No newline at end of file +} diff --git a/src/Components/Validator/RulesValidator.php b/src/Components/Validator/RulesValidator.php index aab196b4..c952fe2c 100644 --- a/src/Components/Validator/RulesValidator.php +++ b/src/Components/Validator/RulesValidator.php @@ -37,7 +37,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $ruleValidators = []; foreach ($set->getRules() as $rule) { - switch ($rule->getName()) { case Rules::NESTING_DEPTH: $maxNestingLevel = (int)$rule->getValue(); @@ -69,7 +68,6 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida /** @var RuleValidatorInterface $validator */ foreach ($ruleValidators as $validator) { - $result = $validator->validate($set, $storage); $allTests = array_merge($allTests, $result->getTests()); @@ -81,5 +79,4 @@ public function validate(TranslationSet $set, StorageInterface $storage): Valida $allErrors ); } - } diff --git a/src/Components/Validator/ValidatorInterface.php b/src/Components/Validator/ValidatorInterface.php index 44a75641..53e11b9a 100644 --- a/src/Components/Validator/ValidatorInterface.php +++ b/src/Components/Validator/ValidatorInterface.php @@ -20,5 +20,4 @@ public function getTypeIdentifier(): string; * @return ValidationResult */ public function validate(TranslationSet $set, StorageInterface $storage): ValidationResult; - } diff --git a/src/Exceptions/ConfigurationException.php b/src/Exceptions/ConfigurationException.php index 1a659740..6475dd5e 100644 --- a/src/Exceptions/ConfigurationException.php +++ b/src/Exceptions/ConfigurationException.php @@ -3,7 +3,7 @@ namespace PHPUnuhi\Exceptions; use Exception; + class ConfigurationException extends Exception { - -} \ No newline at end of file +} diff --git a/src/Exceptions/TranslationNotFoundException.php b/src/Exceptions/TranslationNotFoundException.php index dd605896..eaeeb387 100644 --- a/src/Exceptions/TranslationNotFoundException.php +++ b/src/Exceptions/TranslationNotFoundException.php @@ -3,7 +3,7 @@ namespace PHPUnuhi\Exceptions; use Exception; + class TranslationNotFoundException extends Exception { - -} \ No newline at end of file +} diff --git a/src/Models/Command/CommandOption.php b/src/Models/Command/CommandOption.php index 9ee9dbb3..407777b5 100644 --- a/src/Models/Command/CommandOption.php +++ b/src/Models/Command/CommandOption.php @@ -40,5 +40,4 @@ public function hasValue(): bool { return $this->hasValue; } - } diff --git a/src/Models/Configuration/Attribute.php b/src/Models/Configuration/Attribute.php index 92e0f574..98e944a7 100644 --- a/src/Models/Configuration/Attribute.php +++ b/src/Models/Configuration/Attribute.php @@ -40,5 +40,4 @@ public function getValue(): string { return $this->value; } - } diff --git a/src/Models/Configuration/CaseStyle.php b/src/Models/Configuration/CaseStyle.php index 4b5b2bc3..b590930e 100644 --- a/src/Models/Configuration/CaseStyle.php +++ b/src/Models/Configuration/CaseStyle.php @@ -4,7 +4,6 @@ class CaseStyle { - private const MIN_LEVEL = 0; /** @@ -56,5 +55,4 @@ public function setLevel(int $level): void { $this->level = $level; } - -} \ No newline at end of file +} diff --git a/src/Models/Configuration/Configuration.php b/src/Models/Configuration/Configuration.php index 499dcc47..36d50033 100644 --- a/src/Models/Configuration/Configuration.php +++ b/src/Models/Configuration/Configuration.php @@ -2,7 +2,6 @@ namespace PHPUnuhi\Models\Configuration; - use PHPUnuhi\Models\Translation\TranslationSet; class Configuration @@ -28,5 +27,4 @@ public function getTranslationSets() { return $this->sets; } - } diff --git a/src/Models/Configuration/Filter.php b/src/Models/Configuration/Filter.php index 9d81dcf7..8165ef98 100644 --- a/src/Models/Configuration/Filter.php +++ b/src/Models/Configuration/Filter.php @@ -93,5 +93,4 @@ private function stringMatchWithWildcard(string $haystack, string $wildcard_patt $result = preg_match('/^' . $regex . '$/is', $haystack); return $result === 1; } - } diff --git a/src/Models/Configuration/Marker.php b/src/Models/Configuration/Marker.php index 8bb87449..5e37bc16 100644 --- a/src/Models/Configuration/Marker.php +++ b/src/Models/Configuration/Marker.php @@ -42,5 +42,4 @@ public function getEnd(): string { return $this->end; } - } diff --git a/src/Models/Configuration/Protection.php b/src/Models/Configuration/Protection.php index 3fa815e2..0841bb90 100644 --- a/src/Models/Configuration/Protection.php +++ b/src/Models/Configuration/Protection.php @@ -53,5 +53,4 @@ public function getTerms(): array { return $this->terms; } - } diff --git a/src/Models/Configuration/Rule.php b/src/Models/Configuration/Rule.php index 2036455f..7714f90b 100644 --- a/src/Models/Configuration/Rule.php +++ b/src/Models/Configuration/Rule.php @@ -41,5 +41,4 @@ public function getValue() { return $this->value; } - } diff --git a/src/Models/Configuration/Rules.php b/src/Models/Configuration/Rules.php index 97e43082..da332057 100644 --- a/src/Models/Configuration/Rules.php +++ b/src/Models/Configuration/Rules.php @@ -24,5 +24,4 @@ interface Rules * */ public const DUPLICATE_CONTENT = 'duplicateContent'; - -} \ No newline at end of file +} diff --git a/src/Models/Translation/Locale.php b/src/Models/Translation/Locale.php index 9433a3b5..d55c20c9 100644 --- a/src/Models/Translation/Locale.php +++ b/src/Models/Translation/Locale.php @@ -175,13 +175,12 @@ public function getTranslationIDs(): array /** * @param string $searchID - * @return Translation * @throws TranslationNotFoundException + * @return Translation */ public function findTranslation(string $searchID): Translation { foreach ($this->getTranslations() as $translation) { - if ($translation->getID() === $searchID) { return $translation; } @@ -215,7 +214,6 @@ public function removeTranslation(string $id): void $tmpList = []; foreach ($this->translations as $translation) { - if ($translation->getID() !== $id) { $tmpList[] = $translation; } @@ -224,4 +222,3 @@ public function removeTranslation(string $id): void $this->translations = $tmpList; } } - diff --git a/src/Models/Translation/Translation.php b/src/Models/Translation/Translation.php index 396d3962..ff238c12 100644 --- a/src/Models/Translation/Translation.php +++ b/src/Models/Translation/Translation.php @@ -89,5 +89,4 @@ public function isEmpty(): bool { return (trim($this->value) === ''); } - } diff --git a/src/Models/Translation/TranslationSet.php b/src/Models/Translation/TranslationSet.php index efef93f0..f5406c84 100644 --- a/src/Models/Translation/TranslationSet.php +++ b/src/Models/Translation/TranslationSet.php @@ -191,8 +191,8 @@ public function getAllTranslationIDs(): array /** * @param string $searchID * @param string $searchLocale - * @return array * @throws TranslationNotFoundException + * @return array */ public function findAnyExistingTranslation(string $searchID, string $searchLocale): array { @@ -247,5 +247,4 @@ public function isCompletelyTranslated(string $id): bool return $complete; } - } diff --git a/src/PHPUnuhi.php b/src/PHPUnuhi.php index 8301a70c..02de440c 100644 --- a/src/PHPUnuhi.php +++ b/src/PHPUnuhi.php @@ -24,5 +24,4 @@ public static function getVersion(): string return 'unknown'; } - } diff --git a/src/Services/Connection/ConnectionFactory.php b/src/Services/Connection/ConnectionFactory.php index 3c055dcc..2fc12ab1 100644 --- a/src/Services/Connection/ConnectionFactory.php +++ b/src/Services/Connection/ConnectionFactory.php @@ -25,5 +25,4 @@ public function pdoFromEnv(): PDO return $pdo; } - } diff --git a/src/Services/Coverage/CoverageService.php b/src/Services/Coverage/CoverageService.php index 2ebe6756..e2b0ce7f 100644 --- a/src/Services/Coverage/CoverageService.php +++ b/src/Services/Coverage/CoverageService.php @@ -19,19 +19,15 @@ public function getCoverage(array $sets): CoverageTotal $tmpListSets = []; foreach ($sets as $set) { - $tmpLocales = []; foreach ($set->getLocales() as $locale) { - $tmpLocales[] = new CoverageLocale($locale); } $tmpListSets[] = new CoverageSet($set->getName(), $tmpLocales); - } return new CoverageTotal($tmpListSets); } - } diff --git a/src/Services/Coverage/Models/CoverageLocale.php b/src/Services/Coverage/Models/CoverageLocale.php index c7b2c162..49c0f46f 100644 --- a/src/Services/Coverage/Models/CoverageLocale.php +++ b/src/Services/Coverage/Models/CoverageLocale.php @@ -8,7 +8,6 @@ class CoverageLocale { - use CoverageDataTrait; /** @@ -52,5 +51,4 @@ private function calculate(): void $this->countWords += $wordCounter->getWordCount($translation->getValue()); } } - } diff --git a/src/Services/Coverage/Models/CoverageSet.php b/src/Services/Coverage/Models/CoverageSet.php index acfed5dc..f2c171a1 100644 --- a/src/Services/Coverage/Models/CoverageSet.php +++ b/src/Services/Coverage/Models/CoverageSet.php @@ -6,7 +6,6 @@ class CoverageSet { - use CoverageDataTrait; /** @@ -60,7 +59,6 @@ private function calculate(): void $this->countWords = 0; foreach ($this->localeCoverages as $coverage) { - $this->countTranslated += $coverage->getCountTranslated(); $this->countAll += $coverage->getCountAll(); $this->countWords += $coverage->getWordCount(); diff --git a/src/Services/Coverage/Models/CoverageTotal.php b/src/Services/Coverage/Models/CoverageTotal.php index 987e9956..6fc6bcc7 100644 --- a/src/Services/Coverage/Models/CoverageTotal.php +++ b/src/Services/Coverage/Models/CoverageTotal.php @@ -6,7 +6,6 @@ class CoverageTotal { - use CoverageDataTrait; /** @@ -43,12 +42,9 @@ private function calculate(): void $this->countWords = 0; foreach ($this->coverageSets as $coverage) { - $this->countTranslated += $coverage->getCountTranslated(); $this->countAll += $coverage->getCountAll(); $this->countWords += $coverage->getWordCount(); } } - } - diff --git a/src/Services/Coverage/Traits/CoverageDataTrait.php b/src/Services/Coverage/Traits/CoverageDataTrait.php index d709918d..cc179e5e 100644 --- a/src/Services/Coverage/Traits/CoverageDataTrait.php +++ b/src/Services/Coverage/Traits/CoverageDataTrait.php @@ -56,5 +56,4 @@ public function getWordCount(): int { return $this->countWords; } - } diff --git a/src/Services/GroupName/GroupNameService.php b/src/Services/GroupName/GroupNameService.php index b997c5ae..10b928c2 100644 --- a/src/Services/GroupName/GroupNameService.php +++ b/src/Services/GroupName/GroupNameService.php @@ -6,7 +6,6 @@ class GroupNameService { - use StringTrait; @@ -42,5 +41,4 @@ public function getPropertyName(string $translationId): string return str_replace('group--' . $group . '.', '', $translationId); } - } diff --git a/src/Services/Maths/PercentageCalculator.php b/src/Services/Maths/PercentageCalculator.php index f5fb27a3..522b4db3 100644 --- a/src/Services/Maths/PercentageCalculator.php +++ b/src/Services/Maths/PercentageCalculator.php @@ -29,5 +29,4 @@ public function getRoundedPercentage(int $numberExisting, int $numberTotal): flo return round($percent, 2); } - } diff --git a/src/Services/Placeholder/Placeholder.php b/src/Services/Placeholder/Placeholder.php index 97784750..69747bf5 100644 --- a/src/Services/Placeholder/Placeholder.php +++ b/src/Services/Placeholder/Placeholder.php @@ -40,5 +40,4 @@ public function getValue(): string { return $this->value; } - } diff --git a/src/Services/Placeholder/PlaceholderEncoder.php b/src/Services/Placeholder/PlaceholderEncoder.php index 4c328c93..8ffa0665 100644 --- a/src/Services/Placeholder/PlaceholderEncoder.php +++ b/src/Services/Placeholder/PlaceholderEncoder.php @@ -50,4 +50,4 @@ public function decode(string $text, array $placeholders): string return $tmpValue; } -} \ No newline at end of file +} diff --git a/src/Services/Placeholder/PlaceholderExtractor.php b/src/Services/Placeholder/PlaceholderExtractor.php index 2a01d7df..1aea9941 100644 --- a/src/Services/Placeholder/PlaceholderExtractor.php +++ b/src/Services/Placeholder/PlaceholderExtractor.php @@ -33,7 +33,6 @@ public function extract(string $text, string $markerStart, string $markerEnd): a $placeholders = []; foreach ($uniqueList as $foundValue) { - $ph = new Placeholder($markerStart . $foundValue . $markerEnd); $placeholders[] = $ph; @@ -41,6 +40,4 @@ public function extract(string $text, string $markerStart, string $markerEnd): a return $placeholders; } - - -} \ No newline at end of file +} diff --git a/src/Services/WordCounter/WordCounter.php b/src/Services/WordCounter/WordCounter.php index e2be27b5..00ed0b3b 100644 --- a/src/Services/WordCounter/WordCounter.php +++ b/src/Services/WordCounter/WordCounter.php @@ -13,5 +13,4 @@ public function getWordCount(string $text): int { return str_word_count($text); } - -} \ No newline at end of file +} diff --git a/src/Services/Writers/Directory/DirectoryWriter.php b/src/Services/Writers/Directory/DirectoryWriter.php index e3805f9a..75cc3b8d 100644 --- a/src/Services/Writers/Directory/DirectoryWriter.php +++ b/src/Services/Writers/Directory/DirectoryWriter.php @@ -13,5 +13,4 @@ public function createDirectory(string $path): void { mkdir($path); } - -} \ No newline at end of file +} diff --git a/src/Services/Writers/Directory/DirectoryWriterInterface.php b/src/Services/Writers/Directory/DirectoryWriterInterface.php index 9ff80727..b3f54d7c 100644 --- a/src/Services/Writers/Directory/DirectoryWriterInterface.php +++ b/src/Services/Writers/Directory/DirectoryWriterInterface.php @@ -10,5 +10,4 @@ interface DirectoryWriterInterface * @return void */ public function createDirectory(string $path): void; - -} \ No newline at end of file +} diff --git a/src/Services/Writers/File/FileWriter.php b/src/Services/Writers/File/FileWriter.php index b03b5375..501ea758 100644 --- a/src/Services/Writers/File/FileWriter.php +++ b/src/Services/Writers/File/FileWriter.php @@ -14,5 +14,4 @@ public function writeFile(string $filename, string $content): void { file_put_contents($filename, $content); } - } diff --git a/src/Services/Writers/File/FileWriterInterface.php b/src/Services/Writers/File/FileWriterInterface.php index bfe47998..e287f67d 100644 --- a/src/Services/Writers/File/FileWriterInterface.php +++ b/src/Services/Writers/File/FileWriterInterface.php @@ -11,5 +11,4 @@ interface FileWriterInterface * @return void */ public function writeFile(string $filename, string $content): void; - -} \ No newline at end of file +} diff --git a/src/Services/Writers/Xml/XmlWriter.php b/src/Services/Writers/Xml/XmlWriter.php index be482a46..cf6f9dca 100644 --- a/src/Services/Writers/Xml/XmlWriter.php +++ b/src/Services/Writers/Xml/XmlWriter.php @@ -23,5 +23,4 @@ public function saveXml(string $filename, string $content): void file_put_contents($filename, $out); } - } diff --git a/src/Services/Writers/Xml/XmlWriterInterface.php b/src/Services/Writers/Xml/XmlWriterInterface.php index 4d99e2a3..cf0f2062 100644 --- a/src/Services/Writers/Xml/XmlWriterInterface.php +++ b/src/Services/Writers/Xml/XmlWriterInterface.php @@ -11,5 +11,4 @@ interface XmlWriterInterface * @return void */ public function saveXml(string $filename, string $content): void; - -} \ No newline at end of file +} diff --git a/src/Traits/ArrayTrait.php b/src/Traits/ArrayTrait.php index 0c0be7a1..ee8a41d4 100644 --- a/src/Traits/ArrayTrait.php +++ b/src/Traits/ArrayTrait.php @@ -108,5 +108,4 @@ protected function getMultiDimensionalArray(array $array, string $delimiter): ar return $result; } - } diff --git a/src/Traits/BinaryTrait.php b/src/Traits/BinaryTrait.php index 042ebab6..103f3375 100644 --- a/src/Traits/BinaryTrait.php +++ b/src/Traits/BinaryTrait.php @@ -33,5 +33,4 @@ protected function isBinary(string $str): bool { return preg_match('~[^\x20-\x7E\t\r\n]~', $str) > 0; } - } diff --git a/src/Traits/CommandTrait.php b/src/Traits/CommandTrait.php index 9178de29..4694ba6e 100644 --- a/src/Traits/CommandTrait.php +++ b/src/Traits/CommandTrait.php @@ -73,5 +73,4 @@ protected function getConfigBoolValue(string $name, InputInterface $input): bool return $value; } - } diff --git a/src/Traits/StringTrait.php b/src/Traits/StringTrait.php index 02b0077e..52943694 100644 --- a/src/Traits/StringTrait.php +++ b/src/Traits/StringTrait.php @@ -41,5 +41,4 @@ protected function stringDoesEndsWith(string $string, string $endString): bool } return (substr($string, -$len) === $endString); } - } diff --git a/tests/phpunit/Bundles/Exchange/CSV/CSVExchangeTest.php b/tests/phpunit/Bundles/Exchange/CSV/CSVExchangeTest.php index 425e82b2..2939d8b0 100644 --- a/tests/phpunit/Bundles/Exchange/CSV/CSVExchangeTest.php +++ b/tests/phpunit/Bundles/Exchange/CSV/CSVExchangeTest.php @@ -128,5 +128,4 @@ public function testExportWithGroups(): void $this->assertEquals($expected, $fakeWriter->getWrittenLines()); } - } diff --git a/tests/phpunit/Bundles/Exchange/ExchangeFactoryTest.php b/tests/phpunit/Bundles/Exchange/ExchangeFactoryTest.php index c950959e..49dfef8c 100644 --- a/tests/phpunit/Bundles/Exchange/ExchangeFactoryTest.php +++ b/tests/phpunit/Bundles/Exchange/ExchangeFactoryTest.php @@ -21,8 +21,8 @@ protected function setUp(): void /** - * @return void * @throws ConfigurationException + * @return void */ public function testGetCustomExchangeFormat(): void { @@ -35,8 +35,8 @@ public function testGetCustomExchangeFormat(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testDoubleRegistrationThrowsException(): void { @@ -49,8 +49,8 @@ public function testDoubleRegistrationThrowsException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testUnknownFormatThrowsException(): void { @@ -60,8 +60,8 @@ public function testUnknownFormatThrowsException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testEmptyFormatThrowsException(): void { @@ -69,5 +69,4 @@ public function testEmptyFormatThrowsException(): void ExchangeFactory::getInstance()->getExchange('', []); } - } diff --git a/tests/phpunit/Bundles/Storage/StorageFactoryTest.php b/tests/phpunit/Bundles/Storage/StorageFactoryTest.php index bdc0f9ab..6d8ce8fd 100644 --- a/tests/phpunit/Bundles/Storage/StorageFactoryTest.php +++ b/tests/phpunit/Bundles/Storage/StorageFactoryTest.php @@ -42,8 +42,8 @@ protected function setUp(): void /** * This test verifies that we can successfully register a new storage * and that it will be returned correctly when accessing it. - * @return void * @throws ConfigurationException + * @return void */ public function testGetCustomStorage(): void { @@ -58,8 +58,8 @@ public function testGetCustomStorage(): void /** * This test verifies that we can successfully register a new storage * and that it will be returned for the provided set correctly. - * @return void * @throws ConfigurationException + * @return void */ public function testGetCustomStorageBySet(): void { @@ -70,5 +70,4 @@ public function testGetCustomStorageBySet(): void $this->assertSame($fakeStorage, $storage); } - } diff --git a/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php b/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php index 61721a65..d1aac1e0 100644 --- a/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php +++ b/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php @@ -27,5 +27,4 @@ public function testAllowedFormality(): void $this->assertEquals($expected, DeeplTranslator::ALLOWED_FORMALITY); } - } diff --git a/tests/phpunit/Bundles/Translator/TranslatorFactoryTest.php b/tests/phpunit/Bundles/Translator/TranslatorFactoryTest.php index c61e47df..2bd775a8 100644 --- a/tests/phpunit/Bundles/Translator/TranslatorFactoryTest.php +++ b/tests/phpunit/Bundles/Translator/TranslatorFactoryTest.php @@ -20,8 +20,8 @@ protected function setUp(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testGetCustomTranslator(): void { @@ -34,8 +34,8 @@ public function testGetCustomTranslator(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testUnknownServiceThrowsException(): void { @@ -45,8 +45,8 @@ public function testUnknownServiceThrowsException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testNoServiceNameLeadsToException(): void { @@ -56,8 +56,8 @@ public function testNoServiceNameLeadsToException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testDoubleRegistrationThrowsException(): void { diff --git a/tests/phpunit/Components/Filter/FilterHandlerTest.php b/tests/phpunit/Components/Filter/FilterHandlerTest.php index 6ec07d85..e3639ef5 100644 --- a/tests/phpunit/Components/Filter/FilterHandlerTest.php +++ b/tests/phpunit/Components/Filter/FilterHandlerTest.php @@ -56,4 +56,4 @@ public function testApplyFilter(): void $this->assertCount(2, $set->getAllTranslationIDs()); } -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Repoter/JSON/JsonReporterTest.php b/tests/phpunit/Components/Repoter/JSON/JsonReporterTest.php index a45f7ea6..23f00e86 100644 --- a/tests/phpunit/Components/Repoter/JSON/JsonReporterTest.php +++ b/tests/phpunit/Components/Repoter/JSON/JsonReporterTest.php @@ -13,7 +13,6 @@ class JsonReporterTest extends TestCase { - use TestReportBuilderTrait; use StringCleanerTrait; @@ -138,5 +137,4 @@ public function testReportGeneration(): void $this->assertEquals($expected, $actual); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Repoter/JUnit/JUnitReporterTest.php b/tests/phpunit/Components/Repoter/JUnit/JUnitReporterTest.php index e8ab4ee4..dabd3d94 100644 --- a/tests/phpunit/Components/Repoter/JUnit/JUnitReporterTest.php +++ b/tests/phpunit/Components/Repoter/JUnit/JUnitReporterTest.php @@ -11,10 +11,8 @@ use PHPUnuhi\Components\Reporter\Model\ReportResult; use PHPUnuhi\Components\Reporter\Model\SuiteResult; - class JUnitReporterTest extends TestCase { - use TestReportBuilderTrait; use StringCleanerTrait; @@ -126,5 +124,4 @@ public function testReportGeneration(): void $this->assertEquals($expected, $actual); } - } diff --git a/tests/phpunit/Components/Repoter/Model/ReportResultTest.php b/tests/phpunit/Components/Repoter/Model/ReportResultTest.php index 6351ae38..20d97d2d 100644 --- a/tests/phpunit/Components/Repoter/Model/ReportResultTest.php +++ b/tests/phpunit/Components/Repoter/Model/ReportResultTest.php @@ -89,5 +89,4 @@ public function testFailureCount(): void { $this->assertEquals(1, $this->result->getFailureCount()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Repoter/Model/SuiteResultTest.php b/tests/phpunit/Components/Repoter/Model/SuiteResultTest.php index d3677820..f8a0176e 100644 --- a/tests/phpunit/Components/Repoter/Model/SuiteResultTest.php +++ b/tests/phpunit/Components/Repoter/Model/SuiteResultTest.php @@ -79,5 +79,4 @@ public function testFailureCount(): void { $this->assertEquals(1, $this->result->getFailureCount()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Repoter/Model/TestResultTest.php b/tests/phpunit/Components/Repoter/Model/TestResultTest.php index 4c10f408..3ced3ca4 100644 --- a/tests/phpunit/Components/Repoter/Model/TestResultTest.php +++ b/tests/phpunit/Components/Repoter/Model/TestResultTest.php @@ -76,5 +76,4 @@ public function testTranslationKey(): void { $this->assertEquals('btnCancel', $this->resultFailed->getTranslationKey()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Repoter/ReporterFactoryTest.php b/tests/phpunit/Components/Repoter/ReporterFactoryTest.php index 2de3dd85..f2a7f8ef 100644 --- a/tests/phpunit/Components/Repoter/ReporterFactoryTest.php +++ b/tests/phpunit/Components/Repoter/ReporterFactoryTest.php @@ -12,8 +12,8 @@ class ReporterFactoryTest extends TestCase { /** - * @return void * @throws ConfigurationException + * @return void */ public function testEmptyReportNameThrowsException(): void { @@ -25,8 +25,8 @@ public function testEmptyReportNameThrowsException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testUnknownReporterThrowsException(): void { @@ -38,8 +38,8 @@ public function testUnknownReporterThrowsException(): void } /** - * @return void * @throws ConfigurationException + * @return void */ public function testJUnitReporterIsFound(): void { @@ -49,5 +49,4 @@ public function testJUnitReporterIsFound(): void $this->assertInstanceOf(JUnitReporter::class, $reporter); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/CaseStyle/CaseStyleValidatorFactoryTest.php b/tests/phpunit/Components/Validator/CaseStyle/CaseStyleValidatorFactoryTest.php index 93fe4fcd..fc521f14 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/CaseStyleValidatorFactoryTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/CaseStyleValidatorFactoryTest.php @@ -12,8 +12,8 @@ class CaseStyleValidatorFactoryTest extends TestCase /** - * @return void * @throws CaseStyleNotFoundException + * @return void */ public function testUnknownIdentifierThrowsException(): void { @@ -25,8 +25,8 @@ public function testUnknownIdentifierThrowsException(): void } /** - * @return void * @throws CaseStyleNotFoundException + * @return void */ public function testValidatorFound(): void { @@ -36,4 +36,4 @@ public function testValidatorFound(): void $this->assertInstanceOf(CamelCaseValidator::class, $validator); } -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/CamelCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/CamelCaseValidatorTest.php index dde675bb..4e362ea8 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/CamelCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/CamelCaseValidatorTest.php @@ -57,5 +57,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/KebabCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/KebabCaseValidatorTest.php index 9d1e1dd2..16bec327 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/KebabCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/KebabCaseValidatorTest.php @@ -57,5 +57,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/LowerCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/LowerCaseValidatorTest.php index 7eb7c320..1e8384f1 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/LowerCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/LowerCaseValidatorTest.php @@ -56,5 +56,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/NumberCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/NumberCaseValidatorTest.php index 62af9219..0f4b8c5b 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/NumberCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/NumberCaseValidatorTest.php @@ -58,5 +58,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/PascalCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/PascalCaseValidatorTest.php index 7ab07953..7e1fc210 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/PascalCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/PascalCaseValidatorTest.php @@ -58,5 +58,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/SnakeCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/SnakeCaseValidatorTest.php index 0f9d9349..81b54940 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/SnakeCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/SnakeCaseValidatorTest.php @@ -57,5 +57,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/StartCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/StartCaseValidatorTest.php index 41c425fe..3bc3d1c5 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/StartCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/StartCaseValidatorTest.php @@ -59,5 +59,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyle/Style/UpperCaseValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyle/Style/UpperCaseValidatorTest.php index 5b7275f1..d3504dbc 100644 --- a/tests/phpunit/Components/Validator/CaseStyle/Style/UpperCaseValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyle/Style/UpperCaseValidatorTest.php @@ -59,5 +59,4 @@ public function testIsValid(bool $expectedValid, string $text): void $this->assertEquals($expectedValid, $isValid); } - } diff --git a/tests/phpunit/Components/Validator/CaseStyleValidatorTest.php b/tests/phpunit/Components/Validator/CaseStyleValidatorTest.php index e94805f4..547ac84e 100644 --- a/tests/phpunit/Components/Validator/CaseStyleValidatorTest.php +++ b/tests/phpunit/Components/Validator/CaseStyleValidatorTest.php @@ -14,7 +14,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class CaseStyleValidatorTest extends TestCase { @@ -42,8 +41,8 @@ public function testTypeIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testValidMixedCases(): void { @@ -59,8 +58,8 @@ public function testValidMixedCases(): void } /** - * @return void * @throws Exception + * @return void */ public function testInvalidCases(): void { @@ -75,8 +74,8 @@ public function testInvalidCases(): void } /** - * @return void * @throws Exception + * @return void */ public function testMixedWithLevels(): void { @@ -103,8 +102,8 @@ public function testMixedWithLevels(): void * This means both our ends are only snake case, while the middle part is camel. * This is only valid because level 0 + 2 are snake-validated, and the rest is globally validated with camel. * - * @return void * @throws Exception + * @return void */ public function testMixedWithMissingLevels(): void { @@ -132,8 +131,8 @@ public function testMixedWithMissingLevels(): void * Our global style is snake which would be valid, but our first level is pinned to be * pascal, so it's still not valid. * - * @return void * @throws Exception + * @return void */ public function testGlobalStylesNotValidatedForExistingLevels(): void { @@ -154,8 +153,8 @@ public function testGlobalStylesNotValidatedForExistingLevels(): void * This test verifies that all our levels are correctly checked. * Our 2nd level has an invalid style, so this should break. * - * @return void * @throws Exception + * @return void */ public function testMixedWithInvalidLevels(): void { @@ -177,8 +176,8 @@ public function testMixedWithInvalidLevels(): void } /** - * @return void * @throws Exception + * @return void */ public function testValidCasesWithoutSetStyles(): void { @@ -193,8 +192,8 @@ public function testValidCasesWithoutSetStyles(): void /** * @param string $translationKey * @param array $caseStyles - * @return ValidationResult * @throws CaseStyleNotFoundException + * @return ValidationResult */ private function validateSet(string $translationKey, array $caseStyles): ValidationResult { @@ -216,5 +215,4 @@ private function validateSet(string $translationKey, array $caseStyles): Validat return $this->validator->validate($set, $storage); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/EmptyContentValidatorTest.php b/tests/phpunit/Components/Validator/EmptyContentValidatorTest.php index 64182688..0c4d5fe4 100644 --- a/tests/phpunit/Components/Validator/EmptyContentValidatorTest.php +++ b/tests/phpunit/Components/Validator/EmptyContentValidatorTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class EmptyContentValidatorTest extends TestCase { @@ -39,8 +38,8 @@ public function testTypeIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -62,8 +61,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testEmptyContentFound(): void { @@ -102,5 +101,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/MixedStructureValidatorTest.php b/tests/phpunit/Components/Validator/MixedStructureValidatorTest.php index 27aafa79..8f793375 100644 --- a/tests/phpunit/Components/Validator/MixedStructureValidatorTest.php +++ b/tests/phpunit/Components/Validator/MixedStructureValidatorTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class MixedStructureValidatorTest extends TestCase { @@ -39,8 +38,8 @@ public function testTypeIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -62,8 +61,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testMixedStructureFound(): void { @@ -102,5 +101,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Model/ValidationErrorTest.php b/tests/phpunit/Components/Validator/Model/ValidationErrorTest.php index b596697c..e6aab063 100644 --- a/tests/phpunit/Components/Validator/Model/ValidationErrorTest.php +++ b/tests/phpunit/Components/Validator/Model/ValidationErrorTest.php @@ -75,5 +75,4 @@ public function testLineNumber(): void { $this->assertEquals('14', $this->error->getLineNumber()); } - } diff --git a/tests/phpunit/Components/Validator/Model/ValidationResultTest.php b/tests/phpunit/Components/Validator/Model/ValidationResultTest.php index bf2f78fa..4e3ca89e 100644 --- a/tests/phpunit/Components/Validator/Model/ValidationResultTest.php +++ b/tests/phpunit/Components/Validator/Model/ValidationResultTest.php @@ -60,5 +60,4 @@ public function testGetErrors(): void { $this->assertCount(1, $this->result->getErrors()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Model/ValidationTestTest.php b/tests/phpunit/Components/Validator/Model/ValidationTestTest.php index c9fe7013..c2a3d321 100644 --- a/tests/phpunit/Components/Validator/Model/ValidationTestTest.php +++ b/tests/phpunit/Components/Validator/Model/ValidationTestTest.php @@ -87,4 +87,4 @@ public function testSuccess(): void { $this->assertTrue($this->test->isSuccess()); } -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Rules/DisallowedTextsRuleTest.php b/tests/phpunit/Components/Validator/Rules/DisallowedTextsRuleTest.php index b6790e61..25f03972 100644 --- a/tests/phpunit/Components/Validator/Rules/DisallowedTextsRuleTest.php +++ b/tests/phpunit/Components/Validator/Rules/DisallowedTextsRuleTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class DisallowedTextsRuleTest extends TestCase { @@ -27,8 +26,8 @@ public function getRuleIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -51,8 +50,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testDisallowedTextFound(): void { @@ -97,5 +96,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Rules/DuplicateContentRuleTest.php b/tests/phpunit/Components/Validator/Rules/DuplicateContentRuleTest.php index 27175b7b..f43be2f3 100644 --- a/tests/phpunit/Components/Validator/Rules/DuplicateContentRuleTest.php +++ b/tests/phpunit/Components/Validator/Rules/DuplicateContentRuleTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class DuplicateContentRuleTest extends TestCase { @@ -26,8 +25,8 @@ public function getRuleIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -49,8 +48,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testDuplicateInDifferentLocalesIsValid(): void { @@ -72,8 +71,8 @@ public function testDuplicateInDifferentLocalesIsValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testKeyLengthExceeded(): void { @@ -114,5 +113,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Rules/MaxKeyLengthRuleTest.php b/tests/phpunit/Components/Validator/Rules/MaxKeyLengthRuleTest.php index b69ddfea..c23fd969 100644 --- a/tests/phpunit/Components/Validator/Rules/MaxKeyLengthRuleTest.php +++ b/tests/phpunit/Components/Validator/Rules/MaxKeyLengthRuleTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class MaxKeyLengthRuleTest extends TestCase { @@ -27,8 +26,8 @@ public function getRuleIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -52,8 +51,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testLengthZeroAlwaysValid(): void { @@ -76,8 +75,8 @@ public function testLengthZeroAlwaysValid(): void /** - * @return void * @throws Exception + * @return void */ public function testKeyLengthExceeded(): void { @@ -120,5 +119,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/Rules/NestingDepthRuleTest.php b/tests/phpunit/Components/Validator/Rules/NestingDepthRuleTest.php index 5abe0454..55f82949 100644 --- a/tests/phpunit/Components/Validator/Rules/NestingDepthRuleTest.php +++ b/tests/phpunit/Components/Validator/Rules/NestingDepthRuleTest.php @@ -11,7 +11,6 @@ use PHPUnuhi\Models\Translation\Locale; use PHPUnuhi\Models\Translation\TranslationSet; - class NestingDepthRuleTest extends TestCase { @@ -27,8 +26,8 @@ public function getRuleIdentifier(): void } /** - * @return void * @throws Exception + * @return void */ public function testAllValid(): void { @@ -49,8 +48,8 @@ public function testAllValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testLengthZeroAlwaysValid(): void { @@ -71,8 +70,8 @@ public function testLengthZeroAlwaysValid(): void } /** - * @return void * @throws Exception + * @return void */ public function testNestingDepthReached(): void { @@ -111,5 +110,4 @@ private function buildSet(array $locales): TranslationSet [] ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Components/Validator/RulesValidatorTest.php b/tests/phpunit/Components/Validator/RulesValidatorTest.php index dea2c731..e4af0a16 100644 --- a/tests/phpunit/Components/Validator/RulesValidatorTest.php +++ b/tests/phpunit/Components/Validator/RulesValidatorTest.php @@ -12,7 +12,6 @@ class RulesValidatorTest extends TestCase { - use TranslationSetBuilderTrait; /** diff --git a/tests/phpunit/Models/Command/CommandOptionTest.php b/tests/phpunit/Models/Command/CommandOptionTest.php index d5d601df..12c58141 100644 --- a/tests/phpunit/Models/Command/CommandOptionTest.php +++ b/tests/phpunit/Models/Command/CommandOptionTest.php @@ -37,5 +37,4 @@ public function testHasNoValue(): void $this->assertEquals(false, $option->hasValue()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Models/Configuration/AttributeTest.php b/tests/phpunit/Models/Configuration/AttributeTest.php index e701d130..b5fcb2c4 100644 --- a/tests/phpunit/Models/Configuration/AttributeTest.php +++ b/tests/phpunit/Models/Configuration/AttributeTest.php @@ -27,5 +27,4 @@ public function testValue(): void $this->assertEquals('ini', $attr->getValue()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Models/Configuration/CaseStyleTest.php b/tests/phpunit/Models/Configuration/CaseStyleTest.php index d7a1e3d1..2f351e2d 100644 --- a/tests/phpunit/Models/Configuration/CaseStyleTest.php +++ b/tests/phpunit/Models/Configuration/CaseStyleTest.php @@ -49,5 +49,4 @@ public function testHasLevel(): void $this->assertEquals(true, $style->hasLevel()); } - } diff --git a/tests/phpunit/Models/Configuration/ConfigurationTest.php b/tests/phpunit/Models/Configuration/ConfigurationTest.php index 8f5ce925..4be20981 100644 --- a/tests/phpunit/Models/Configuration/ConfigurationTest.php +++ b/tests/phpunit/Models/Configuration/ConfigurationTest.php @@ -23,5 +23,4 @@ public function testTranslationSets(): void $this->assertCount(1, $config->getTranslationSets()); } - } diff --git a/tests/phpunit/Models/Configuration/FilterTest.php b/tests/phpunit/Models/Configuration/FilterTest.php index 9d43b3f4..09533026 100644 --- a/tests/phpunit/Models/Configuration/FilterTest.php +++ b/tests/phpunit/Models/Configuration/FilterTest.php @@ -123,5 +123,4 @@ public function testIncludeCanBeExcludedMultipleTimes(): void $this->assertEquals(false, $isAllowed); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Models/Configuration/MarkerTest.php b/tests/phpunit/Models/Configuration/MarkerTest.php index 14fcb97e..b803ace3 100644 --- a/tests/phpunit/Models/Configuration/MarkerTest.php +++ b/tests/phpunit/Models/Configuration/MarkerTest.php @@ -27,5 +27,4 @@ public function testEnd(): void $this->assertEquals('>', $marker->getEnd()); } - } diff --git a/tests/phpunit/Models/Configuration/ProtectionTest.php b/tests/phpunit/Models/Configuration/ProtectionTest.php index 2b92fac7..9b78d70e 100644 --- a/tests/phpunit/Models/Configuration/ProtectionTest.php +++ b/tests/phpunit/Models/Configuration/ProtectionTest.php @@ -47,5 +47,4 @@ public function testAddTermDuplicateSkipped(): void $this->assertCount(2, $protection->getTerms()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Models/Configuration/RuleTest.php b/tests/phpunit/Models/Configuration/RuleTest.php index acee1e58..19b52bea 100644 --- a/tests/phpunit/Models/Configuration/RuleTest.php +++ b/tests/phpunit/Models/Configuration/RuleTest.php @@ -27,5 +27,4 @@ public function testValue(): void $this->assertEquals('black', $rule->getValue()); } - } diff --git a/tests/phpunit/Models/Translation/LocaleTest.php b/tests/phpunit/Models/Translation/LocaleTest.php index 367652a6..3ee939de 100644 --- a/tests/phpunit/Models/Translation/LocaleTest.php +++ b/tests/phpunit/Models/Translation/LocaleTest.php @@ -172,8 +172,8 @@ public function testFindLineNumber(): void * This test verifies that we do not add translations twice, * but do correctly update them in this case. * - * @return void * @throws TranslationNotFoundException + * @return void */ public function testAddTranslationAvoidDuplicates(): void { @@ -190,5 +190,4 @@ public function testAddTranslationAvoidDuplicates(): void $this->assertCount(1, $localeEN->getTranslationIDs()); $this->assertEquals('Abbrechen', $localeEN->findTranslation('btnCancel')->getValue()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Models/Translation/TranslationSetTest.php b/tests/phpunit/Models/Translation/TranslationSetTest.php index 4ada21bf..444ca3ff 100644 --- a/tests/phpunit/Models/Translation/TranslationSetTest.php +++ b/tests/phpunit/Models/Translation/TranslationSetTest.php @@ -45,8 +45,8 @@ public function testFormat(): void } /** - * @return void * @throws Exception + * @return void */ public function testProtection(): void { @@ -63,8 +63,8 @@ public function testProtection(): void } /** - * @return void * @throws Exception + * @return void */ public function testRules(): void { @@ -153,8 +153,8 @@ public function testGetLocales(): void } /** - * @return void * @throws TranslationNotFoundException + * @return void */ public function testFindAnyExistingTranslation(): void { @@ -182,8 +182,8 @@ public function testFindAnyExistingTranslation(): void } /** - * @return void * @throws TranslationNotFoundException + * @return void */ public function testFindAnyExistingTranslationWithLocale(): void { @@ -215,8 +215,8 @@ public function testFindAnyExistingTranslationWithLocale(): void } /** - * @return void * @throws Exception + * @return void */ public function testFindAnyExistingTranslationNotFound(): void { @@ -271,5 +271,4 @@ public function testIsCompletelyTranslated(): void $isTranslated = $set->isCompletelyTranslated('btnCancel'); $this->assertTrue($isTranslated); } - } diff --git a/tests/phpunit/Models/Translation/TranslationTest.php b/tests/phpunit/Models/Translation/TranslationTest.php index d40b79b1..0e31d6a1 100644 --- a/tests/phpunit/Models/Translation/TranslationTest.php +++ b/tests/phpunit/Models/Translation/TranslationTest.php @@ -59,5 +59,4 @@ public function testGroup(): void $this->assertEquals('product-123', $translation->getGroup()); } - } diff --git a/tests/phpunit/Services/Connection/ConnectionFactoryTest.php b/tests/phpunit/Services/Connection/ConnectionFactoryTest.php index 48af84b9..d2bd82bc 100644 --- a/tests/phpunit/Services/Connection/ConnectionFactoryTest.php +++ b/tests/phpunit/Services/Connection/ConnectionFactoryTest.php @@ -27,5 +27,4 @@ public function testPdoObjectBuiltCorrectly(): void $this->assertInstanceOf(PDO::class, $conn); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Services/Coverage/CoverageServiceTest.php b/tests/phpunit/Services/Coverage/CoverageServiceTest.php index 37500c0d..6d638951 100644 --- a/tests/phpunit/Services/Coverage/CoverageServiceTest.php +++ b/tests/phpunit/Services/Coverage/CoverageServiceTest.php @@ -67,5 +67,4 @@ public function testGetCoverage(): void $this->assertEquals(60, $coverage->getCoverage()); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Services/Coverage/Models/CoverageLocaleTest.php b/tests/phpunit/Services/Coverage/Models/CoverageLocaleTest.php index dd449544..e426caa3 100644 --- a/tests/phpunit/Services/Coverage/Models/CoverageLocaleTest.php +++ b/tests/phpunit/Services/Coverage/Models/CoverageLocaleTest.php @@ -87,5 +87,4 @@ public function testCountTranslated(): void $this->assertEquals(3, $value); } - } diff --git a/tests/phpunit/Services/Coverage/Models/CoverageSetTest.php b/tests/phpunit/Services/Coverage/Models/CoverageSetTest.php index 0ce08126..8a36440c 100644 --- a/tests/phpunit/Services/Coverage/Models/CoverageSetTest.php +++ b/tests/phpunit/Services/Coverage/Models/CoverageSetTest.php @@ -104,5 +104,4 @@ public function testWordCount(): void $this->assertEquals(5, $value); } - } diff --git a/tests/phpunit/Services/Coverage/Models/CoverageTotalTest.php b/tests/phpunit/Services/Coverage/Models/CoverageTotalTest.php index 4e6513fe..c6378cc2 100644 --- a/tests/phpunit/Services/Coverage/Models/CoverageTotalTest.php +++ b/tests/phpunit/Services/Coverage/Models/CoverageTotalTest.php @@ -104,5 +104,4 @@ public function testCoverage(): void $this->assertEquals(50, $value); } - } diff --git a/tests/phpunit/Services/GroupName/GroupNameServiceTest.php b/tests/phpunit/Services/GroupName/GroupNameServiceTest.php index 80899534..3c7f79f0 100644 --- a/tests/phpunit/Services/GroupName/GroupNameServiceTest.php +++ b/tests/phpunit/Services/GroupName/GroupNameServiceTest.php @@ -58,5 +58,4 @@ public function testInvalidGroupName(): void $this->assertEquals('no-group--1', $propertyKey); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Services/Maths/PercentageCalculatorTest.php b/tests/phpunit/Services/Maths/PercentageCalculatorTest.php index 1491e40d..cb88a18b 100644 --- a/tests/phpunit/Services/Maths/PercentageCalculatorTest.php +++ b/tests/phpunit/Services/Maths/PercentageCalculatorTest.php @@ -43,5 +43,4 @@ public function testEmptyMeansFull(): void $this->assertEquals(100, $result); } - } diff --git a/tests/phpunit/Services/Placeholder/PlaceholderEncoderTest.php b/tests/phpunit/Services/Placeholder/PlaceholderEncoderTest.php index 2879aa5d..50c6ba28 100644 --- a/tests/phpunit/Services/Placeholder/PlaceholderEncoderTest.php +++ b/tests/phpunit/Services/Placeholder/PlaceholderEncoderTest.php @@ -8,7 +8,6 @@ class PlaceholderEncoderTest extends TestCase { - private const MARKER = '//'; @@ -67,5 +66,4 @@ public function testDecode(): void $this->assertEquals('Hello, my name is {firstname} {lastname}! Thank you for your attention', $encodedString); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Services/Placeholder/PlaceholderExtractorTest.php b/tests/phpunit/Services/Placeholder/PlaceholderExtractorTest.php index b5769118..6064eece 100644 --- a/tests/phpunit/Services/Placeholder/PlaceholderExtractorTest.php +++ b/tests/phpunit/Services/Placeholder/PlaceholderExtractorTest.php @@ -80,5 +80,4 @@ public function testPlaceholderWithSpace(): void $this->assertEquals('{firstname lastname}', $placeholders[0]->getValue()); } - } diff --git a/tests/phpunit/Services/Placeholder/PlaceholderTest.php b/tests/phpunit/Services/Placeholder/PlaceholderTest.php index 402da9ba..815c9d40 100644 --- a/tests/phpunit/Services/Placeholder/PlaceholderTest.php +++ b/tests/phpunit/Services/Placeholder/PlaceholderTest.php @@ -27,5 +27,4 @@ public function testValue(): void $this->assertEquals('{firstname}', $ph->getValue()); } - } diff --git a/tests/phpunit/Services/WordCounter/WordCounterTest.php b/tests/phpunit/Services/WordCounter/WordCounterTest.php index 3fe91748..6912517d 100644 --- a/tests/phpunit/Services/WordCounter/WordCounterTest.php +++ b/tests/phpunit/Services/WordCounter/WordCounterTest.php @@ -43,5 +43,4 @@ public function testCountOfEmptyString(): void $this->assertEquals(0, $words); } - } diff --git a/tests/phpunit/Traits/ArrayTraitTest.php b/tests/phpunit/Traits/ArrayTraitTest.php index ba62e317..ee61f11d 100644 --- a/tests/phpunit/Traits/ArrayTraitTest.php +++ b/tests/phpunit/Traits/ArrayTraitTest.php @@ -7,7 +7,6 @@ class ArrayTraitTest extends TestCase { - use ArrayTrait; /** @@ -195,5 +194,4 @@ public function testGetLineNumbersWithClosingBrackets(): void $this->assertEquals($expected, $flat); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Traits/BinaryTraitTest.php b/tests/phpunit/Traits/BinaryTraitTest.php index 0fb3ad51..1cd14844 100644 --- a/tests/phpunit/Traits/BinaryTraitTest.php +++ b/tests/phpunit/Traits/BinaryTraitTest.php @@ -7,7 +7,6 @@ class BinaryTraitTest extends TestCase { - use BinaryTrait; /** @@ -64,5 +63,4 @@ public function testIsBinaryFalse(): void $this->assertFalse($isBinary); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Traits/StringTraitTest.php b/tests/phpunit/Traits/StringTraitTest.php index 640dc640..30bc90e0 100644 --- a/tests/phpunit/Traits/StringTraitTest.php +++ b/tests/phpunit/Traits/StringTraitTest.php @@ -7,7 +7,6 @@ class StringTraitTest extends TestCase { - use StringTrait; /** @@ -79,5 +78,4 @@ public function testStringEndsWithEmptySearchString(): void $this->assertEquals(true, $contains); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeCSVWriter.php b/tests/phpunit/Utils/Fakes/FakeCSVWriter.php index c3d20d31..1e577a31 100644 --- a/tests/phpunit/Utils/Fakes/FakeCSVWriter.php +++ b/tests/phpunit/Utils/Fakes/FakeCSVWriter.php @@ -66,5 +66,4 @@ public function close($file): void { // TODO: Implement close() method. } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeDirectoryWriter.php b/tests/phpunit/Utils/Fakes/FakeDirectoryWriter.php index 1f9d90d9..cba72bf4 100644 --- a/tests/phpunit/Utils/Fakes/FakeDirectoryWriter.php +++ b/tests/phpunit/Utils/Fakes/FakeDirectoryWriter.php @@ -29,5 +29,4 @@ public function createDirectory(string $path): void { $this->createdDirectory = $path; } - } diff --git a/tests/phpunit/Utils/Fakes/FakeExchangeFormat.php b/tests/phpunit/Utils/Fakes/FakeExchangeFormat.php index 8c9353ff..53dedfaf 100644 --- a/tests/phpunit/Utils/Fakes/FakeExchangeFormat.php +++ b/tests/phpunit/Utils/Fakes/FakeExchangeFormat.php @@ -8,10 +8,9 @@ class FakeExchangeFormat implements ExchangeInterface { - public function getName(): string { - return 'fake'; + return 'fake'; } public function getOptions(): array @@ -33,6 +32,4 @@ public function import(string $filename): ImportResult { // TODO: Implement import() method. } - - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeFileWriter.php b/tests/phpunit/Utils/Fakes/FakeFileWriter.php index 477becd0..5f88d194 100644 --- a/tests/phpunit/Utils/Fakes/FakeFileWriter.php +++ b/tests/phpunit/Utils/Fakes/FakeFileWriter.php @@ -44,5 +44,4 @@ public function writeFile(string $filename, string $content): void $this->providedFilename = $filename; $this->providedContent = $content; } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeStorage.php b/tests/phpunit/Utils/Fakes/FakeStorage.php index 4721d50b..99e59a71 100644 --- a/tests/phpunit/Utils/Fakes/FakeStorage.php +++ b/tests/phpunit/Utils/Fakes/FakeStorage.php @@ -49,5 +49,4 @@ public function saveTranslationLocale(Locale $locale, string $filename): Storage { // TODO: Implement saveTranslationLocale() method. } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeTranslator.php b/tests/phpunit/Utils/Fakes/FakeTranslator.php index 4b9b5059..0defdf6b 100644 --- a/tests/phpunit/Utils/Fakes/FakeTranslator.php +++ b/tests/phpunit/Utils/Fakes/FakeTranslator.php @@ -25,5 +25,4 @@ public function translate(string $text, string $sourceLocale, string $targetLoca { // TODO: Implement translate() method. } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Fakes/FakeXmlWriter.php b/tests/phpunit/Utils/Fakes/FakeXmlWriter.php index c5145afc..3582a368 100644 --- a/tests/phpunit/Utils/Fakes/FakeXmlWriter.php +++ b/tests/phpunit/Utils/Fakes/FakeXmlWriter.php @@ -44,5 +44,4 @@ public function saveXml(string $filename, string $content): void $this->providedFilename = $filename; $this->providedXml = $content; } - } diff --git a/tests/phpunit/Utils/Traits/StringCleanerTrait.php b/tests/phpunit/Utils/Traits/StringCleanerTrait.php index 402f2bcd..ee2f97cb 100644 --- a/tests/phpunit/Utils/Traits/StringCleanerTrait.php +++ b/tests/phpunit/Utils/Traits/StringCleanerTrait.php @@ -16,4 +16,4 @@ protected function buildComparableString(string $text): string return str_replace(' ', '', $text); } -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Traits/TestReportBuilderTrait.php b/tests/phpunit/Utils/Traits/TestReportBuilderTrait.php index 2db59eb2..d3f501ba 100644 --- a/tests/phpunit/Utils/Traits/TestReportBuilderTrait.php +++ b/tests/phpunit/Utils/Traits/TestReportBuilderTrait.php @@ -23,5 +23,4 @@ protected function buildTestResult(bool $success): TestResult $success ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Traits/TranslationSetBuilderTrait.php b/tests/phpunit/Utils/Traits/TranslationSetBuilderTrait.php index cb94f0cb..ed852dee 100644 --- a/tests/phpunit/Utils/Traits/TranslationSetBuilderTrait.php +++ b/tests/phpunit/Utils/Traits/TranslationSetBuilderTrait.php @@ -27,5 +27,4 @@ protected function buildTranslationSet(array $locales, array $rules): Translatio $rules ); } - -} \ No newline at end of file +}