Skip to content

Commit cab405d

Browse files
authored
Merge pull request #331 from voicecode-bv/master
Replace more helpers
2 parents cfb2110 + fadb90e commit cab405d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Manager.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Barryvdh\TranslationManager;
44

55
use Illuminate\Support\Arr;
6+
use Illuminate\Support\Str;
67
use Symfony\Component\Finder\Finder;
78
use Illuminate\Filesystem\Filesystem;
89
use Illuminate\Contracts\Events\Dispatcher;
@@ -259,13 +260,13 @@ public function exportTranslations($group = null, $json = false)
259260
if ($group == '*') {
260261
return $this->exportAllTranslations();
261262
} else {
262-
if (starts_with($group, 'vendor')) {
263+
if (Str::startsWith($group, 'vendor')) {
263264
$vendor = true;
264265
}
265266
}
266267

267268
$tree = $this->makeTree(Translation::ofTranslatedGroup($group)
268-
->orderByGroupKeys(array_get($this->config, 'sort_keys', false))
269+
->orderByGroupKeys(Arr::get($this->config, 'sort_keys', false))
269270
->get());
270271

271272
foreach ($tree as $locale => $groups) {
@@ -276,7 +277,7 @@ public function exportTranslations($group = null, $json = false)
276277
$locale_path = $locale.DIRECTORY_SEPARATOR.$group;
277278
if ($vendor) {
278279
$path = $basePath.'/'.$group.'/'.$locale;
279-
$locale_path = str_after($group, '/');
280+
$locale_path = Str::after($group, '/');
280281
}
281282
$subfolders = explode(DIRECTORY_SEPARATOR, $locale_path);
282283
array_pop($subfolders);
@@ -303,7 +304,7 @@ public function exportTranslations($group = null, $json = false)
303304

304305
if ($json) {
305306
$tree = $this->makeTree(Translation::ofTranslatedGroup(self::JSON_GROUP)
306-
->orderByGroupKeys(array_get($this->config, 'sort_keys', false))
307+
->orderByGroupKeys(Arr::get($this->config, 'sort_keys', false))
307308
->get(), true);
308309

309310
foreach ($tree as $locale => $groups) {
@@ -344,7 +345,7 @@ protected function makeTree($translations, $json = false)
344345
$this->jsonSet($array[$translation->locale][$translation->group], $translation->key,
345346
$translation->value);
346347
} else {
347-
array_set($array[$translation->locale][$translation->group], $translation->key,
348+
Arr::set($array[$translation->locale][$translation->group], $translation->key,
348349
$translation->value);
349350
}
350351
}

0 commit comments

Comments
 (0)