@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | $code = array_filter(array_slice($lines, $start, $end - $start + 1, true), 'trim'); |
74 | 74 | $max = strlen($end); |
75 | - $cite->code = implode("\n", array_map(function ($u, $v) use ($max) { |
|
75 | + $cite->code = implode("\n", array_map(function($u, $v) use ($max) { |
|
76 | 76 | return sprintf("%{$max}d %s", $u + 1, rtrim($v)); |
77 | 77 | }, array_keys($code), $code)); |
78 | 78 | $cite->save(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | function sweep() |
92 | 92 | { |
93 | 93 | array_map( |
94 | - function ($u) { |
|
94 | + function($u) { |
|
95 | 95 | $u->sweep(); |
96 | 96 | }, |
97 | 97 | array_merge( |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | if (empty($this->term)) { |
38 | 38 | sweep(); |
39 | - array_map(function ($u) { |
|
39 | + array_map(function($u) { |
|
40 | 40 | self::dispatch($u, $this->locales)->onQueue('translation'); |
41 | 41 | }, VocabTerm::get()->all()); |
42 | 42 | } else { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public function up() |
20 | 20 | { |
21 | 21 | $connection = config('trans-helper.database.connection') ?: config('database.default'); |
22 | - Schema::connection($connection)->create(config('trans-helper.database.table.cite'), function (Blueprint $table) { |
|
22 | + Schema::connection($connection)->create(config('trans-helper.database.table.cite'), function(Blueprint $table) { |
|
23 | 23 | $table->bigIncrements('id'); |
24 | 24 | $table->string('file', 256)->default(''); |
25 | 25 | $table->unsignedBigInteger('line'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | Schema::connection($connection)->create( |
40 | 40 | config('trans-helper.database.table.term'), |
41 | - function (Blueprint $table) { |
|
41 | + function(Blueprint $table) { |
|
42 | 42 | $table->bigIncrements('id'); |
43 | 43 | $table->string('namespace', 256)->default(''); |
44 | 44 | $table->string('term', 256)->default(''); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | Schema::connection($connection)->create( |
57 | 57 | config('trans-helper.database.table.link'), |
58 | - function (Blueprint $table) { |
|
58 | + function(Blueprint $table) { |
|
59 | 59 | $table->unsignedBigInteger('cited'); |
60 | 60 | $table->unsignedBigInteger('vocab'); |
61 | 61 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $this->publishes( |
31 | 31 | [ |
32 | - __DIR__.'/config/trans-helper.php' => config_path('trans-helper.php'), |
|
32 | + __DIR__ . '/config/trans-helper.php' => config_path('trans-helper.php'), |
|
33 | 33 | ] |
34 | 34 | ); |
35 | 35 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function boot() |
41 | 41 | { |
42 | - $this->loadMigrationsFrom(__DIR__.'/migration'); |
|
42 | + $this->loadMigrationsFrom(__DIR__ . '/migration'); |
|
43 | 43 | if ($this->app->runningInConsole()) { |
44 | 44 | $this->publishAssets(); |
45 | 45 | } |
@@ -32,19 +32,19 @@ |
||
32 | 32 | |
33 | 33 | public function sweep() |
34 | 34 | { |
35 | - $line = explode("\n", file_get_contents(base_path().$this->file)); |
|
35 | + $line = explode("\n", file_get_contents(base_path() . $this->file)); |
|
36 | 36 | $line = $line[$this->line - 1] ?? ''; |
37 | 37 | if ($line) { |
38 | 38 | $terms = call_user_func_array( |
39 | 39 | 'array_merge', |
40 | 40 | array_map( |
41 | - function ($u) { |
|
42 | - return ["localize('{$u->term}')", 'localize("'.$u->term.'")']; |
|
41 | + function($u) { |
|
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 |