Skip to content

Commit

Permalink
Fix file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Jul 11, 2022
1 parent be446fe commit b51b05a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Drivers/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ public function getGroupTranslationsFor(string $language): Collection
if (Str::contains($group->getPathname(), 'vendor')) {
$vendor = Str::before(Str::after($group->getPathname(), 'vendor' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR);

return ["{$vendor}::{$group->getBasename('.php')}" => new Collection(Arr::dot($this->disk->getRequire($group->getPathname())))];
return ["{$vendor}::{$group->getBasename('.php')}" => new Collection($this->disk->getRequire($group->getPathname()))];
}

return [$group->getBasename('.php') => new Collection(Arr::dot($this->disk->getRequire($group->getPathname())))];
return [$group->getBasename('.php') => new Collection($this->disk->getRequire($group->getPathname()))];
});
}

Expand Down Expand Up @@ -228,13 +228,13 @@ public function saveGroupTranslations(string $language, string $group, Collectio

return;
}
$this->disk->put("{$this->languageFilesPath}" . DIRECTORY_SEPARATOR . "{$language}" . DIRECTORY_SEPARATOR . "{$group}.php", "<?php\n\nreturn " . var_export($translations, true) . ';' . \PHP_EOL);
$this->disk->put("{$this->languageFilesPath}" . DIRECTORY_SEPARATOR . "{$language}" . DIRECTORY_SEPARATOR . "{$group}.php", "<?php\n\nreturn " . var_export($translations->toArray(), true) . ';' . \PHP_EOL);
}

/**
* Save namespaced group type language translations.
*/
private function saveNamespacedGroupTranslations(string $language, string $group, string $translations): void
private function saveNamespacedGroupTranslations(string $language, string $group, Collection $translations): void
{
[$namespace, $group] = explode('::', $group);
$directory = "{$this->languageFilesPath}" . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . "{$namespace}" . DIRECTORY_SEPARATOR . "{$language}";
Expand All @@ -243,7 +243,7 @@ private function saveNamespacedGroupTranslations(string $language, string $group
$this->disk->makeDirectory($directory, 0755, true);
}

$this->disk->put("$directory" . DIRECTORY_SEPARATOR . "{$group}.php", "<?php\n\nreturn " . var_export($translations, true) . ';' . \PHP_EOL);
$this->disk->put("$directory" . DIRECTORY_SEPARATOR . "{$group}.php", "<?php\n\nreturn " . var_export($translations->toArray(), true) . ';' . \PHP_EOL);
}

/**
Expand Down

0 comments on commit b51b05a

Please sign in to comment.