@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | private function registerBindings() |
| 57 | 57 | { |
| 58 | - $this->app->bind(TranslationRepository::class, function () { |
|
| 58 | + $this->app->bind(TranslationRepository::class, function() { |
|
| 59 | 59 | $repository = new EloquentTranslationRepository(new Translation()); |
| 60 | 60 | |
| 61 | 61 | return new CacheTranslationDecorator($repository); |
| 62 | 62 | }); |
| 63 | 63 | |
| 64 | - $this->app->bind(FileTranslationRepository::class, function ($app) { |
|
| 65 | - return new FileDiskTranslationRepository($app['files'], $app['translation.loader']); |
|
| 64 | + $this->app->bind(FileTranslationRepository::class, function($app) { |
|
| 65 | + return new FileDiskTranslationRepository($app[ 'files' ], $app[ 'translation.loader' ]); |
|
| 66 | 66 | }); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -78,17 +78,17 @@ discard block |
||
| 78 | 78 | $this->app->offsetUnset('translation.loader'); |
| 79 | 79 | $this->app->offsetUnset('translator'); |
| 80 | 80 | |
| 81 | - $this->app->singleton('translation.loader', function ($app) { |
|
| 82 | - return new TranslationLoader($app['files'], $app['path.lang']); |
|
| 81 | + $this->app->singleton('translation.loader', function($app) { |
|
| 82 | + return new TranslationLoader($app[ 'files' ], $app[ 'path.lang' ]); |
|
| 83 | 83 | }); |
| 84 | - $this->app->singleton('translator', function ($app) { |
|
| 85 | - $loader = $app['translation.loader']; |
|
| 84 | + $this->app->singleton('translator', function($app) { |
|
| 85 | + $loader = $app[ 'translation.loader' ]; |
|
| 86 | 86 | |
| 87 | - $locale = $app['config']['app.locale']; |
|
| 87 | + $locale = $app[ 'config' ][ 'app.locale' ]; |
|
| 88 | 88 | |
| 89 | 89 | $trans = new Translator($loader, $locale); |
| 90 | 90 | |
| 91 | - $trans->setFallback($app['config']['app.fallback_locale']); |
|
| 91 | + $trans->setFallback($app[ 'config' ][ 'app.fallback_locale' ]); |
|
| 92 | 92 | |
| 93 | 93 | return $trans; |
| 94 | 94 | }); |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | private function registerValidators() |
| 98 | 98 | { |
| 99 | - Validator::extend('extensions', function ($attribute, $value, $parameters) { |
|
| 99 | + Validator::extend('extensions', function($attribute, $value, $parameters) { |
|
| 100 | 100 | return in_array($value->getClientOriginalExtension(), $parameters); |
| 101 | 101 | }); |
| 102 | 102 | |
| 103 | - Validator::replacer('extensions', function ($message, $attribute, $rule, $parameters) { |
|
| 104 | - return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message); |
|
| 103 | + Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) { |
|
| 104 | + return str_replace([ ':attribute', ':values' ], [ $attribute, implode(',', $parameters) ], $message); |
|
| 105 | 105 | }); |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $files = $this->getTranslationFilenamesFromPaths($this->loader->paths()); |
| 31 | 31 | |
| 32 | - $translations = []; |
|
| 32 | + $translations = [ ]; |
|
| 33 | 33 | |
| 34 | 34 | foreach ($files as $locale => $files) { |
| 35 | 35 | foreach ($files as $namespace => $file) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $trans = array_dot($trans); |
| 38 | 38 | |
| 39 | 39 | foreach ($trans as $key => $value) { |
| 40 | - $translations[$locale]["{$namespace}.{$key}"] = $value; |
|
| 40 | + $translations[ $locale ][ "{$namespace}.{$key}" ] = $value; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -53,17 +53,17 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | protected function getTranslationFilenamesFromPaths(array $paths) |
| 55 | 55 | { |
| 56 | - $files = []; |
|
| 56 | + $files = [ ]; |
|
| 57 | 57 | $locales = config('laravellocalization.supportedLocales'); |
| 58 | 58 | |
| 59 | 59 | foreach ($paths as $hint => $path) { |
| 60 | 60 | foreach ($locales as $locale => $language) { |
| 61 | 61 | foreach ($this->finder->glob("{$path}/{$locale}/*.php") as $file) { |
| 62 | - $category = str_replace(["$path/", ".php", "{$locale}/"], "", $file); |
|
| 62 | + $category = str_replace([ "$path/", ".php", "{$locale}/" ], "", $file); |
|
| 63 | 63 | $category = str_replace("/", ".", $category); |
| 64 | 64 | $category = !is_int($hint) ? "{$hint}::{$category}" : $category; |
| 65 | 65 | |
| 66 | - $files[$locale][$category] = $file; |
|
| 66 | + $files[ $locale ][ $category ] = $file; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -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 | } |