Skip to content

Commit a72820e

Browse files
committed
prepare for php5
1 parent a88ed87 commit a72820e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Manager.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Manager
3535
* @param Filesystem $disk
3636
* @param string $path
3737
*/
38-
public function __construct(Filesystem $disk, string $path, array $viewsPaths)
38+
public function __construct(Filesystem $disk, $path, array $viewsPaths)
3939
{
4040
$this->disk = $disk;
4141
$this->path = $path;
@@ -75,9 +75,13 @@ public function files()
7575
*/
7676
public function languages()
7777
{
78-
return array_map(function ($directory) {
78+
$languages = array_map(function ($directory) {
7979
return str_replace($this->path.'/', '', $directory);
8080
}, $this->disk->directories($this->path));
81+
82+
asort($languages);
83+
84+
return $languages;
8185
}
8286

8387
/**
@@ -105,7 +109,7 @@ public function createFile($fileName)
105109
* @param array $keys
106110
* @return void
107111
*/
108-
public function fillKeys(string $fileName, array $keys)
112+
public function fillKeys($fileName, array $keys)
109113
{
110114
$appends = [];
111115

@@ -135,7 +139,7 @@ public function fillKeys(string $fileName, array $keys)
135139
* @param string $key
136140
* @return void
137141
*/
138-
public function removeKey(string $fileName, string $key)
142+
public function removeKey($fileName, $key)
139143
{
140144
foreach ($this->languages() as $language) {
141145
$filePath = $this->path."/{$language}/{$fileName}.php";
@@ -155,7 +159,7 @@ public function removeKey(string $fileName, string $key)
155159
* @param array $translations
156160
* @return void
157161
*/
158-
public function writeFile(string $filePath, array $translations)
162+
public function writeFile($filePath, array $translations)
159163
{
160164
$content = "<?php \n\nreturn [";
161165

0 commit comments

Comments
 (0)