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 | |
@@ -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 | { |
@@ -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; |
@@ -174,7 +180,7 @@ discard block |
||
| 174 | 180 | * @param Array $data the array that will be modified |
| 175 | 181 | * @param Array $keys the keys (path) |
| 176 | 182 | * @param String $value the value to be added |
| 177 | - * @return Array |
|
| 183 | + * @return string |
|
| 178 | 184 | */ |
| 179 | 185 | private function setArrayValue(&$data, $keys, $value) { |
| 180 | 186 | foreach ($keys as $key) { |
@@ -184,10 +190,16 @@ discard block |
||
| 184 | 190 | return $data = $value; |
| 185 | 191 | } |
| 186 | 192 | |
| 193 | + /** |
|
| 194 | + * @return string |
|
| 195 | + */ |
|
| 187 | 196 | private function getFilePath(){ |
| 188 | 197 | return base_path("resources/lang/{$this->lang}/{$this->file}.php"); |
| 189 | 198 | } |
| 190 | 199 | |
| 200 | + /** |
|
| 201 | + * @return string |
|
| 202 | + */ |
|
| 191 | 203 | private function getLangPath(){ |
| 192 | 204 | return base_path("resources/lang/{$this->lang}/"); |
| 193 | 205 | } |