Skip to content

Commit 673f12b

Browse files
committed
pint compatible
1 parent 5bc2eca commit 673f12b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Commands/SortAllTranslationsCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ class SortAllTranslationsCommand extends Command
1414

1515
public function handle(): int
1616
{
17-
$namespacesArg = explode(',', (string) $this->option('namespaces'));
18-
$localesArg = explode(',', (string) $this->option('locales'));
17+
$namespacesArg = $this->option('namespaces');
18+
$localesArg = $this->option('locales');
1919

2020
$locales = collect(Translator::getLanguages())
21-
->when($localesArg, fn (Collection $items) => $items->intersect($localesArg));
21+
->when($localesArg, fn (Collection $items) => $items->intersect(explode(',', $localesArg)));
2222

2323
foreach ($locales as $locale) {
2424
$this->newLine();
2525
$this->info("Sorting {$locale}");
2626

2727
$namespaces = collect(Translator::getNamespaces($locale))
28-
->when($namespacesArg, fn (Collection $items) => $items->intersect($namespacesArg));
28+
->when($namespacesArg, fn (Collection $items) => $items->intersect(explode(',', $namespacesArg)));
2929

3030
$this->withProgressBar(
3131
$namespaces,

src/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ public function saveTranslations(
276276
string $namespace,
277277
Translations $translations,
278278
): bool {
279-
$content = "<?php \n\nreturn [";
279+
$content = "<?php\n\nreturn [";
280280

281281
$content .= $translations->toFile();
282282

283-
$content .= "\n];";
283+
$content .= "\n];\n";
284284

285285
return $this->storage->put(
286286
"{$locale}/{$namespace}.php",

0 commit comments

Comments
 (0)