@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function up() |
| 19 | 19 | { |
| 20 | 20 | $connection = config('trans-helper.database.connection') ?: config('database.default'); |
| 21 | - Schema::connection($connection)->create(config('trans-helper.database.table.cites'), function (Blueprint $table) { |
|
| 21 | + Schema::connection($connection)->create(config('trans-helper.database.table.cites'), function(Blueprint $table) { |
|
| 22 | 22 | $table->bigIncrements('id'); |
| 23 | 23 | $table->string('file', 256)->default(''); |
| 24 | 24 | $table->unsignedBigInteger('line'); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | }); |
| 37 | 37 | Schema::connection($connection)->create( |
| 38 | 38 | config('trans-helper.database.database.table.term'), |
| 39 | - function (Blueprint $table) { |
|
| 39 | + function(Blueprint $table) { |
|
| 40 | 40 | $table->bigIncrements('id'); |
| 41 | 41 | $table->string('namespace', 256)->default(''); |
| 42 | 42 | $table->string('term', 256)->default(''); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | Schema::connection($connection)->create( |
| 55 | 55 | config('trans-helper.database.database.table.link'), |
| 56 | - function (Blueprint $table) { |
|
| 56 | + function(Blueprint $table) { |
|
| 57 | 57 | $table->unsignedBigInteger('cited'); |
| 58 | 58 | $table->unsignedBigInteger('vocab'); |
| 59 | 59 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $this->publishes( |
| 31 | 31 | [ |
| 32 | - dirname(__DIR__).'/config/trans-helper.php' => config_path('trans-helper.php'), |
|
| 32 | + dirname(__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(dirname(__DIR__).'/migration'); |
|
| 42 | + $this->loadMigrationsFrom(dirname(__DIR__) . '/migration'); |
|
| 43 | 43 | if ($this->app->runningInConsole()) { |
| 44 | 44 | $this->publishAssets(); |
| 45 | 45 | } |
@@ -38,13 +38,13 @@ |
||
| 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 | |
@@ -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\t%s", $u, rtrim($v)); |
| 77 | 77 | }, array_keys($code), $code)); |
| 78 | 78 | $cite->save(); |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | if (!function_exists('sweep')) { |
| 90 | 90 | function sweep() |
| 91 | 91 | { |
| 92 | - call_user_func_array(function ($u) { |
|
| 92 | + call_user_func_array(function($u) { |
|
| 93 | 93 | $u->sweep(); |
| 94 | 94 | }, config('trans-helper.model.cite')::get()->all()); |
| 95 | 95 | |
| 96 | - call_user_func_array(function ($u) { |
|
| 96 | + call_user_func_array(function($u) { |
|
| 97 | 97 | $u->sweep(); |
| 98 | 98 | }, config('trans-helper.model.term')::get()->all()); |
| 99 | 99 | } |