Skip to content

Commit

Permalink
fix phpstan and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bottelet committed Sep 19, 2024
1 parent ff17fc0 commit 985a78a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ php artisan translations:check en
```json
{
"test.value": "Value",
"translate this string": "translate this string"
"translate this string": null
}
```
The reason we default to null when no translation service are used is because it defaults to the key used in the function call.

## Quick Start

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/FindMissingTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function parseOptions(): CommandOptions
}

/**
* @param array<string, string> $missingTranslations
* @param array<string, string|null> $missingTranslations
*/
private function printMissingTranslations(array $missingTranslations): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Finder/MissingKeysFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function findTranslatableStrings(array $files): array
* @param array<int, SplFileInfo> $files
* @param array<string, string> $existingTranslatedStrings
*
* @return array<string, string>
* @return array<string, string|null>
*/
public function findMissingTranslatableStrings(array $files, array $existingTranslatedStrings): array
{
Expand All @@ -48,7 +48,7 @@ public function findMissingTranslatableStrings(array $files, array $existingTran
/**
* @param array<string> $foundStrings
* @param array<string, string> $jsonTranslations
* @return array<string, string>
* @return array<string, string|null>
*/
protected function extractMissingTranslations(array $foundStrings, array $jsonTranslations): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Finder/TranslationFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getLanguageFilerManager(): LanguageFileManager
/**
* @param array<string> $sourceFilePaths
*
* @return array<string, string>
* @return array<string, string|null>
*/
public function findMissingTranslations(array $sourceFilePaths): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/TranslationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(

/**
* @param array<string> $sourceFilePaths
* @return array<string, string>
* @return array<string, string|null>
*/
public function updateTranslationsFromFile(array $sourceFilePaths, string $targetJsonPath, bool $sort = false, ?string $targetLanguage = null, bool $translateMissing = false, string $sourceLanguage = 'en'): array
{
Expand Down

0 comments on commit 985a78a

Please sign in to comment.