@@ -65,7 +65,6 @@ |
||
| 65 | 65 | /** |
| 66 | 66 | * Create the migration. |
| 67 | 67 | * |
| 68 | - * @param string $name |
|
| 69 | 68 | * @return bool |
| 70 | 69 | */ |
| 71 | 70 | protected function createMigration($table) |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->info('Migration successfully created!'); |
| 54 | 54 | } else { |
| 55 | 55 | $this->error( |
| 56 | - 'Couldn\'t create migration.'.PHP_EOL.' Check the write permissions |
|
| 56 | + 'Couldn\'t create migration.' . PHP_EOL . ' Check the write permissions |
|
| 57 | 57 | within the database/migrations directory.' |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | /** |
| 146 | 146 | * Get the services provided by the provider. |
| 147 | 147 | * |
| 148 | - * @return array |
|
| 148 | + * @return string[] |
|
| 149 | 149 | */ |
| 150 | 150 | public function provides() |
| 151 | 151 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | // Register blade directives |
| 46 | - Blade::directive('t', function ($expression) { |
|
| 46 | + Blade::directive('t', function($expression) { |
|
| 47 | 47 | return "<?php echo e(t({$expression})); ?>"; |
| 48 | 48 | }); |
| 49 | 49 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $configPath = __DIR__ . '/../config/config.php'; |
| 60 | 60 | $this->mergeConfigFrom($configPath, 'debugbar'); |
| 61 | 61 | |
| 62 | - $this->app->singleton('multilang', function ($app) { |
|
| 62 | + $this->app->singleton('multilang', function($app) { |
|
| 63 | 63 | $locale = $app->getLocale(); |
| 64 | 64 | $environment = $app->environment(); |
| 65 | 65 | $config = $app['config']->get('multilang'); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $multilang->setLocale($locale); |
| 75 | 75 | |
| 76 | 76 | if ($multilang->autoSaveIsAllowed()) { |
| 77 | - $this->app->terminating(function () use ($multilang) { |
|
| 77 | + $this->app->terminating(function() use ($multilang) { |
|
| 78 | 78 | return $multilang->saveTexts(); |
| 79 | 79 | }); |
| 80 | 80 | } |
@@ -85,13 +85,13 @@ discard block |
||
| 85 | 85 | $this->app->alias('multilang', 'Longman\LaravelMultiLang\MultiLang'); |
| 86 | 86 | |
| 87 | 87 | $this->app['command.multilang.migration'] = $this->app->share( |
| 88 | - function ($app) { |
|
| 88 | + function($app) { |
|
| 89 | 89 | return new MigrationCommand(); |
| 90 | 90 | } |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | 93 | $this->app['command.multilang.texts'] = $this->app->share( |
| 94 | - function ($app) { |
|
| 94 | + function($app) { |
|
| 95 | 95 | return new TextsCommand(); |
| 96 | 96 | } |
| 97 | 97 | ); |
@@ -35,7 +35,6 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Get translated text |
| 37 | 37 | * |
| 38 | - * @param mixed $key |
|
| 39 | 38 | * @return mixed |
| 40 | 39 | */ |
| 41 | 40 | function t($text) |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @param array $config |
| 88 | 88 | * @param \Illuminate\Cache\CacheManager $cache |
| 89 | 89 | * @param \Illuminate\Database\DatabaseManager $db |
| 90 | - * @return void |
|
| 90 | + * @return string |
|
| 91 | 91 | */ |
| 92 | 92 | public function __construct($environment, array $config, CacheContract $cache, DatabaseContract $db) |
| 93 | 93 | { |
@@ -120,6 +120,9 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $key |
|
| 125 | + */ |
|
| 123 | 126 | public function getConfig($key = null) |
| 124 | 127 | { |
| 125 | 128 | if ($key === null) { |
@@ -133,7 +136,7 @@ discard block |
||
| 133 | 136 | * Set locale and load texts |
| 134 | 137 | * |
| 135 | 138 | * @param string $lang |
| 136 | - * @param \Illuminate\Support\Collection|array $text |
|
| 139 | + * @param \Illuminate\Support\Collection|array $texts |
|
| 137 | 140 | * @return void |
| 138 | 141 | */ |
| 139 | 142 | public function setLocale($lang, $texts = null) |
@@ -183,7 +186,6 @@ discard block |
||
| 183 | 186 | * Get translated text |
| 184 | 187 | * |
| 185 | 188 | * @param string $key |
| 186 | - * @param string $default |
|
| 187 | 189 | * @return string |
| 188 | 190 | */ |
| 189 | 191 | public function get($key) |
@@ -211,7 +213,7 @@ discard block |
||
| 211 | 213 | * Get texts |
| 212 | 214 | * |
| 213 | 215 | * @param string $lang |
| 214 | - * @return string |
|
| 216 | + * @return Collection |
|
| 215 | 217 | */ |
| 216 | 218 | public function getTexts($lang = null) |
| 217 | 219 | { |
@@ -265,6 +267,9 @@ discard block |
||
| 265 | 267 | return $status; |
| 266 | 268 | } |
| 267 | 269 | |
| 270 | + /** |
|
| 271 | + * @param string|null $lang |
|
| 272 | + */ |
|
| 268 | 273 | protected function loadTextsFromDatabase($lang) |
| 269 | 274 | { |
| 270 | 275 | $texts = $lang ? $this->db->table($this->getTableName()) |