We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,14 +1,10 @@ |
||
| 1 | 1 | <?php namespace Backpack\LangFileManager\app\Http\Controllers; |
| 2 | 2 | |
| 3 | -use App\Http\Requests; |
|
| 4 | -use App\Http\Controllers\Controller; |
|
| 5 | 3 | use Backpack\CRUD\app\Http\Controllers\CrudController; |
| 6 | -use Backpack\LangFileManager\app\Services\LangFiles; |
|
| 7 | 4 | use Backpack\LangFileManager\app\Models\Language; |
| 8 | - |
|
| 5 | +use Backpack\LangFileManager\app\Services\LangFiles; |
|
| 9 | 6 | use Illuminate\Http\Request; |
| 10 | 7 | // VALIDATION: change the requests to match your own file names if you need form validation |
| 11 | -use Backpack\LangFileManager\app\Http\Requests\LanguageRequest as StoreRequest; |
|
| 12 | 8 | use Backpack\LangFileManager\app\Http\Requests\LanguageRequest as UpdateRequest; |
| 13 | 9 | |
| 14 | 10 | class LanguageCrudController extends CrudController { |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php namespace Backpack\TranslationManager\app\Http\Requests; |
| 2 | 2 | |
| 3 | -use App\Http\Requests\Request; |
|
| 4 | 3 | use Backpack\CRUD\app\Http\Requests\CrudRequest as CrudRequest; |
| 5 | 4 | |
| 6 | 5 | class LanguageRequest extends CrudRequest { |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php namespace Backpack\LangFileManager\app\Models; |
| 2 | 2 | |
| 3 | -use Illuminate\Database\Eloquent\Model; |
|
| 4 | 3 | use Backpack\CRUD\CrudTrait; |
| 4 | +use Illuminate\Database\Eloquent\Model; |
|
| 5 | 5 | |
| 6 | 6 | class Language extends Model { |
| 7 | 7 | |
@@ -10,11 +10,17 @@ discard block |
||
| 10 | 10 | $this->lang = config('app.locale'); |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param string $lang |
|
| 15 | + */ |
|
| 13 | 16 | public function setLanguage($lang) { |
| 14 | 17 | $this->lang = $lang; |
| 15 | 18 | return $this; |
| 16 | 19 | } |
| 17 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $file |
|
| 23 | + */ |
|
| 18 | 24 | public function setFile($file) { |
| 19 | 25 | $this->file = $file; |
| 20 | 26 | return $this; |
@@ -22,8 +28,6 @@ discard block |
||
| 22 | 28 | |
| 23 | 29 | /** |
| 24 | 30 | * get the content of a language file as an array sorted ascending |
| 25 | - * @param String $lang the language (abbrevation) for which the file is edited |
|
| 26 | - * @param String $file the file that is edited |
|
| 27 | 31 | * @return Array/Bool |
| 28 | 32 | */ |
| 29 | 33 | public function getFileContent() { |
@@ -42,8 +46,6 @@ discard block |
||
| 42 | 46 | /** |
| 43 | 47 | * rewrite the file with the modified texts |
| 44 | 48 | * @param Array $postArray the data received from the form |
| 45 | - * @param String $lang the language |
|
| 46 | - * @param String $file the file |
|
| 47 | 49 | * @return Integer |
| 48 | 50 | */ |
| 49 | 51 | public function setFileContent($postArray) { |
@@ -57,8 +59,6 @@ discard block |
||
| 57 | 59 | |
| 58 | 60 | /** |
| 59 | 61 | * get the language files that can be edited, to ignore a file add it in the config/admin file to language_ignore key |
| 60 | - * @param String $lang the language (abbrevation) for which we want the language files |
|
| 61 | - * @param String $activeFile the file that is opened for editing |
|
| 62 | 62 | * @return Array |
| 63 | 63 | */ |
| 64 | 64 | public function getlangFiles() { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * @param Array $data the array that will be modified |
| 182 | 182 | * @param Array $keys the keys (path) |
| 183 | 183 | * @param String $value the value to be added |
| 184 | - * @return Array |
|
| 184 | + * @return string |
|
| 185 | 185 | */ |
| 186 | 186 | private function setArrayValue(&$data, $keys, $value) { |
| 187 | 187 | foreach ($keys as $key) { |
@@ -191,10 +191,16 @@ discard block |
||
| 191 | 191 | return $data = $value; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | + /** |
|
| 195 | + * @return string |
|
| 196 | + */ |
|
| 194 | 197 | private function getFilePath(){ |
| 195 | 198 | return base_path("resources/lang/{$this->lang}/{$this->file}.php"); |
| 196 | 199 | } |
| 197 | 200 | |
| 201 | + /** |
|
| 202 | + * @return string |
|
| 203 | + */ |
|
| 198 | 204 | private function getLangPath(){ |
| 199 | 205 | return base_path("resources/lang/{$this->lang}/"); |
| 200 | 206 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php namespace Backpack\LangFileManager; |
| 2 | 2 | |
| 3 | -use Illuminate\Support\ServiceProvider; |
|
| 4 | -use Illuminate\Routing\Router; |
|
| 5 | 3 | use Backpack\LangFileManager\app\Services\LangFiles; |
| 4 | +use Illuminate\Routing\Router; |
|
| 5 | +use Illuminate\Support\ServiceProvider; |
|
| 6 | 6 | |
| 7 | 7 | class LangFileManagerServiceProvider extends ServiceProvider |
| 8 | 8 | { |