@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | function localize($languages, string $failback = '') |
| 17 | 17 | { |
| 18 | 18 | if (is_array($languages) || is_json($languages)) { |
| 19 | - $languages = (!is_array($languages)) ? (array) json_decode($languages) : $languages; |
|
| 19 | + $languages = (!is_array($languages)) ? (array)json_decode($languages) : $languages; |
|
| 20 | 20 | $locales = array_keys($languages); |
| 21 | 21 | $system = \App::getLocale(); |
| 22 | 22 | $default = config('app.locale'); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $cite['class'] = array_key_exists('class', $tracer[0]) ? $tracer[0]['line'] : ''; |
| 36 | 36 | $vocab = []; |
| 37 | 37 | $vocab['namespace'] = preg_replace( |
| 38 | - '/(^'.addcslashes(base_path(), '\/').')|(\.php$)/', |
|
| 38 | + '/(^' . addcslashes(base_path(), '\/') . ')|(\.php$)/', |
|
| 39 | 39 | '', |
| 40 | 40 | $cite['file'] |
| 41 | 41 | ); |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | $vocab->save(); |
| 47 | 47 | } |
| 48 | 48 | $cite['file'] = preg_replace( |
| 49 | - '/^'.addcslashes(base_path(), '\/').'/', |
|
| 49 | + '/^' . addcslashes(base_path(), '\/') . '/', |
|
| 50 | 50 | '', |
| 51 | 51 | $cite['file'] |
| 52 | 52 | ); |
| 53 | 53 | $cite = config('trans-helper.model.cite')::firstOrCreate($cite); |
| 54 | 54 | $vocab->cites()->sync([$cite->id], false); |
| 55 | 55 | if (!$cite->code) { |
| 56 | - $lines = explode("\n", file_get_contents(base_path().$cite->file)); |
|
| 56 | + $lines = explode("\n", file_get_contents(base_path() . $cite->file)); |
|
| 57 | 57 | $cite->code = $lines[$cite->line - 1]; |
| 58 | 58 | if (substr($cite->file, -10) != '.blade.php') { |
| 59 | 59 | for ($start = $cite->line - 2; $start > -1; $start--) { |
@@ -38,13 +38,13 @@ |
||
| 38 | 38 | $terms = call_user_func_array( |
| 39 | 39 | 'array_merge', |
| 40 | 40 | array_map( |
| 41 | - function ($u) { |
|
| 41 | + function($u) { |
|
| 42 | 42 | return ["localize('{$u->term}')", 'localize("' . $u->term . '")']; |
| 43 | 43 | }, |
| 44 | 44 | $this->terms()->get()->all() |
| 45 | 45 | ) |
| 46 | 46 | ); |
| 47 | - $matched = array_filter(array_map(function ($u) use ($line) { |
|
| 47 | + $matched = array_filter(array_map(function($u) use ($line) { |
|
| 48 | 48 | return strpos($line, $u); |
| 49 | 49 | }, $terms), 'strlen'); |
| 50 | 50 | |