@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | foreach ($tree as $locale => $groups) { |
33 | 33 | foreach ($groups as $moduleName => $fileGroup) { |
34 | 34 | foreach ($fileGroup as $file => $data) { |
35 | - $path = $this->getTranslationsDirectory() . $moduleName . '/' . $locale . '/' . $file . '.php'; |
|
36 | - $output = "<?php\n\nreturn " . var_export($data, true) . ";\n"; |
|
35 | + $path = $this->getTranslationsDirectory().$moduleName.'/'.$locale.'/'.$file.'.php'; |
|
36 | + $output = "<?php\n\nreturn ".var_export($data, true).";\n"; |
|
37 | 37 | $this->finder->put($path, $output); |
38 | 38 | } |
39 | 39 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | private function getTranslationsDirectory() |
57 | 57 | { |
58 | - return __DIR__ . '/../Resources/lang/'; |
|
58 | + return __DIR__.'/../Resources/lang/'; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | private function getFileNameFrom($key) |
67 | 67 | { |
68 | - $key = str_replace($this->getModuleNameFrom($key) . '::', '', $key); |
|
68 | + $key = str_replace($this->getModuleNameFrom($key).'::', '', $key); |
|
69 | 69 | |
70 | 70 | return substr($key, 0, strpos($key, '.')); |
71 | 71 | } |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | */ |
78 | 78 | private function makeTree(TranslationGroup $translations) |
79 | 79 | { |
80 | - $tree = []; |
|
80 | + $tree = [ ]; |
|
81 | 81 | |
82 | 82 | foreach ($translations->allRaw() as $locale => $translation) { |
83 | 83 | foreach ($translation as $key => $trans) { |
84 | 84 | $moduleName = $this->getModuleNameFrom($key); |
85 | 85 | $fileName = $this->getFileNameFrom($key); |
86 | - $key = str_replace($moduleName . '::' . $fileName . '.', '', $key); |
|
86 | + $key = str_replace($moduleName.'::'.$fileName.'.', '', $key); |
|
87 | 87 | |
88 | - array_set($tree[$locale][$moduleName][$fileName], $key, $trans); |
|
88 | + array_set($tree[ $locale ][ $moduleName ][ $fileName ], $key, $trans); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function export() |
21 | 21 | { |
22 | 22 | $data = $this->formatData(); |
23 | - $keys = array_keys($data[0]); |
|
23 | + $keys = array_keys($data[ 0 ]); |
|
24 | 24 | |
25 | 25 | $csv = Writer::createFromFileObject(new SplTempFileObject()); |
26 | 26 | $csv->insertOne($keys); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | private function getFileName() |
35 | 35 | { |
36 | - return $this->filename . time() . '.csv'; |
|
36 | + return $this->filename.time().'.csv'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | $translations = $this->translations->getFileAndDatabaseMergedTranslations(); |
45 | 45 | $translations = $translations->all(); |
46 | 46 | |
47 | - $data = []; |
|
47 | + $data = [ ]; |
|
48 | 48 | foreach ($translations as $key => $translation) { |
49 | - $data[] = array_merge(['key' => $key], $translation); |
|
49 | + $data[ ] = array_merge([ 'key' => $key ], $translation); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $data; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $translation = $translation->translate($request->get('locale')); |
38 | 38 | |
39 | 39 | if (null === $translation) { |
40 | - return response()->json(['<tr><td>' . trans('translation::translations.No Revisions yet') . '</td></tr>']); |
|
40 | + return response()->json([ '<tr><td>'.trans('translation::translations.No Revisions yet').'</td></tr>' ]); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return response()->json($this->formatRevisionHistory($translation->revisionHistory)); |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | |
46 | 46 | private function formatRevisionHistory(Collection $revisionHistory) |
47 | 47 | { |
48 | - $formattedHistory = []; |
|
48 | + $formattedHistory = [ ]; |
|
49 | 49 | |
50 | 50 | foreach ($revisionHistory as $history) { |
51 | 51 | if ($history->key == 'created_at' && !$history->old_value) { |
52 | - $formattedHistory[] = $this->getCreatedRevisionTemplate($history); |
|
52 | + $formattedHistory[ ] = $this->getCreatedRevisionTemplate($history); |
|
53 | 53 | } else { |
54 | - $formattedHistory[] = $this->getRevisionTemplate($history); |
|
54 | + $formattedHistory[ ] = $this->getRevisionTemplate($history); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | private function getRevisionTemplate($history) |
62 | 62 | { |
63 | 63 | $timeAgo = $history->created_at->diffForHumans(); |
64 | - $revertRoute = route('admin.translation.translation.update', [$history->revisionable_id, 'oldValue' => $history->oldValue()]); |
|
64 | + $revertRoute = route('admin.translation.translation.update', [ $history->revisionable_id, 'oldValue' => $history->oldValue() ]); |
|
65 | 65 | $edited = trans('translation::translations.edited'); |
66 | 66 | |
67 | 67 | return <<<HTML |