@@ -20,11 +20,11 @@ |
||
20 | 20 | */ |
21 | 21 | private function reArrangeTranslations(array $translationsRaw) |
22 | 22 | { |
23 | - $translations = []; |
|
23 | + $translations = [ ]; |
|
24 | 24 | |
25 | 25 | foreach ($translationsRaw as $locale => $translationGroup) { |
26 | 26 | foreach ($translationGroup as $key => $translation) { |
27 | - $translations[$key][$locale] = $translation; |
|
27 | + $translations[ $key ][ $locale ] = $translation; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @param bool $fallback |
16 | 16 | * @return string |
17 | 17 | */ |
18 | - public function get($key, array $replace = [], $locale = null, $fallback = true) |
|
18 | + public function get($key, array $replace = [ ], $locale = null, $fallback = true) |
|
19 | 19 | { |
20 | 20 | $translationRepository = app(TranslationRepository::class); |
21 | 21 | if ($translation = $translationRepository->findByKeyAndLocale($key, $locale)) { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('revisions', function (Blueprint $table) { |
|
15 | + Schema::create('revisions', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('revisionable_type'); |
18 | 18 | $table->integer('revisionable_id'); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public function paths() |
10 | 10 | { |
11 | 11 | return array_merge( |
12 | - [$this->path], |
|
12 | + [ $this->path ], |
|
13 | 13 | $this->hints |
14 | 14 | ); |
15 | 15 | } |
@@ -3,6 +3,6 @@ |
||
3 | 3 | use Illuminate\Routing\Router; |
4 | 4 | |
5 | 5 | /** @var $router Router */ |
6 | -post('translation/update', ['uses' => 'TranslationController@update', 'as' => 'api.translation.translations.update', ]); |
|
7 | -post('translation/clearCache', ['uses' => 'TranslationController@clearCache', 'as' => 'api.translation.translations.clearCache']); |
|
8 | -post('translation/revisions', ['uses' => 'TranslationController@revisions', 'as' => 'api.translation.translations.revisions']); |
|
6 | +post('translation/update', [ 'uses' => 'TranslationController@update', 'as' => 'api.translation.translations.update', ]); |
|
7 | +post('translation/clearCache', [ 'uses' => 'TranslationController@clearCache', 'as' => 'api.translation.translations.clearCache' ]); |
|
8 | +post('translation/revisions', [ 'uses' => 'TranslationController@revisions', 'as' => 'api.translation.translations.revisions' ]); |
@@ -4,12 +4,12 @@ |
||
4 | 4 | |
5 | 5 | /** @var Router $router */ |
6 | 6 | |
7 | -$router->group(['prefix' =>'/translation'], function (Router $router) { |
|
8 | - $router->bind('translations', function ($id) { |
|
7 | +$router->group([ 'prefix' =>'/translation' ], function(Router $router) { |
|
8 | + $router->bind('translations', function($id) { |
|
9 | 9 | return \Modules\Translation\Entities\TranslationTranslation::find($id); |
10 | 10 | }); |
11 | - get('translations', ['uses' => 'TranslationController@index', 'as' => 'admin.translation.translation.index', ]); |
|
12 | - get('translations/update/{translations}', ['uses' => 'TranslationController@update', 'as' => 'admin.translation.translation.update', ]); |
|
13 | - get('translations/export', ['uses' => 'TranslationController@export', 'as' => 'admin.translation.translation.export', ]); |
|
14 | - post('translations/import', ['uses' => 'TranslationController@import', 'as' => 'admin.translation.translation.import', ]); |
|
11 | + get('translations', [ 'uses' => 'TranslationController@index', 'as' => 'admin.translation.translation.index', ]); |
|
12 | + get('translations/update/{translations}', [ 'uses' => 'TranslationController@update', 'as' => 'admin.translation.translation.update', ]); |
|
13 | + get('translations/export', [ 'uses' => 'TranslationController@export', 'as' => 'admin.translation.translation.export', ]); |
|
14 | + post('translations/import', [ 'uses' => 'TranslationController@import', 'as' => 'admin.translation.translation.import', ]); |
|
15 | 15 | }); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::table('translation__translations', function (Blueprint $table) { |
|
14 | + Schema::table('translation__translations', function(Blueprint $table) { |
|
15 | 15 | $table->index('key'); |
16 | 16 | }); |
17 | 17 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function down() |
24 | 24 | { |
25 | - Schema::table('translation__translations', function (Blueprint $table) { |
|
25 | + Schema::table('translation__translations', function(Blueprint $table) { |
|
26 | 26 | $table->dropIndex('key'); |
27 | 27 | }); |
28 | 28 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | use RevisionableTrait; |
12 | 12 | public $timestamps = false; |
13 | - protected $fillable = ['value']; |
|
13 | + protected $fillable = [ 'value' ]; |
|
14 | 14 | protected $table = 'translation__translation_translations'; |
15 | 15 | |
16 | 16 | protected $revisionEnabled = true; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | protected $historyLimit = 100; |
19 | 19 | protected $revisionCreationsEnabled = true; |
20 | 20 | |
21 | - public function __construct(array $attributes = []) |
|
21 | + public function __construct(array $attributes = [ ]) |
|
22 | 22 | { |
23 | 23 | parent::__construct($attributes); |
24 | 24 | $this->historyLimit = config('asgard.translation.config.revision-history-limit', 100); |
@@ -78,18 +78,18 @@ discard block |
||
78 | 78 | |
79 | 79 | private function registerBindings() |
80 | 80 | { |
81 | - $this->app->bind(TranslationRepository::class, function () { |
|
81 | + $this->app->bind(TranslationRepository::class, function() { |
|
82 | 82 | $repository = new EloquentTranslationRepository(new Translation()); |
83 | 83 | |
84 | - if (! config('app.cache')) { |
|
84 | + if (!config('app.cache')) { |
|
85 | 85 | return $repository; |
86 | 86 | } |
87 | 87 | |
88 | 88 | return new CacheTranslationDecorator($repository); |
89 | 89 | }); |
90 | 90 | |
91 | - $this->app->bind(FileTranslationRepository::class, function ($app) { |
|
92 | - return new FileDiskTranslationRepository($app['files'], $app['translation.loader']); |
|
91 | + $this->app->bind(FileTranslationRepository::class, function($app) { |
|
92 | + return new FileDiskTranslationRepository($app[ 'files' ], $app[ 'translation.loader' ]); |
|
93 | 93 | }); |
94 | 94 | } |
95 | 95 | |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | $this->app->offsetUnset('translation.loader'); |
106 | 106 | $this->app->offsetUnset('translator'); |
107 | 107 | |
108 | - $this->app->singleton('translation.loader', function ($app) { |
|
109 | - return new TranslationLoader($app['files'], $app['path.lang']); |
|
108 | + $this->app->singleton('translation.loader', function($app) { |
|
109 | + return new TranslationLoader($app[ 'files' ], $app[ 'path.lang' ]); |
|
110 | 110 | }); |
111 | - $this->app->singleton('translator', function ($app) { |
|
112 | - $loader = $app['translation.loader']; |
|
111 | + $this->app->singleton('translator', function($app) { |
|
112 | + $loader = $app[ 'translation.loader' ]; |
|
113 | 113 | |
114 | - $locale = $app['config']['app.locale']; |
|
114 | + $locale = $app[ 'config' ][ 'app.locale' ]; |
|
115 | 115 | |
116 | 116 | $trans = new Translator($loader, $locale); |
117 | 117 | |
118 | - $trans->setFallback($app['config']['app.fallback_locale']); |
|
118 | + $trans->setFallback($app[ 'config' ][ 'app.fallback_locale' ]); |
|
119 | 119 | |
120 | 120 | return $trans; |
121 | 121 | }); |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | |
124 | 124 | private function registerValidators() |
125 | 125 | { |
126 | - Validator::extend('extensions', function ($attribute, $value, $parameters) { |
|
126 | + Validator::extend('extensions', function($attribute, $value, $parameters) { |
|
127 | 127 | return in_array($value->getClientOriginalExtension(), $parameters); |
128 | 128 | }); |
129 | 129 | |
130 | - Validator::replacer('extensions', function ($message, $attribute, $rule, $parameters) { |
|
131 | - return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message); |
|
130 | + Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) { |
|
131 | + return str_replace([ ':attribute', ':values' ], [ $attribute, implode(',', $parameters) ], $message); |
|
132 | 132 | }); |
133 | 133 | } |
134 | 134 | } |