Passed
Branch master (1a7c8a)
by Robin
05:27
created
Category
src/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     function localize($languages, string $failback = '')
16 16
     {
17 17
         if (is_array($languages) || is_json($languages)) {
18
-            $languages = (!is_array($languages)) ? (array)json_decode($languages)  : $languages;
18
+            $languages = (!is_array($languages)) ? (array)json_decode($languages) : $languages;
19 19
             $locales = array_keys($languages);
20 20
             $system = \App::getLocale();
21 21
             $default = config('app.locale');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                     }
70 70
                     $code = array_filter(array_slice($lines, $start, $end - $start + 1, true), 'trim');
71 71
                     $max = strlen($end);
72
-                    $cite->code = implode("\n", array_map(function ($u, $v) use ($max) {
72
+                    $cite->code = implode("\n", array_map(function($u, $v) use ($max) {
73 73
                         return sprintf("%{$max}d\t%s", $u, rtrim($v));
74 74
                     }, array_keys($code), $code));
75 75
                     $cite->save();
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 if (!function_exists('sweep')) {
85 85
     function sweep()
86 86
     {
87
-        call_user_func_array(function ($u) {
87
+        call_user_func_array(function($u) {
88 88
             $u->sweep();
89 89
         }, config('trans-helper.model.cite')::get()->all());
90 90
 
91
-        call_user_func_array(function ($u) {
91
+        call_user_func_array(function($u) {
92 92
             $u->sweep();
93 93
         }, config('trans-helper.model.term')::get()->all());
94 94
     }
Please login to merge, or discard this patch.
migrations/2019_03_11_103021_create_vocabularies_table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
models/VocabCite.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@
 block discarded – undo
35 35
         $line = explode("\n", file_get_contents($this->file));
36 36
         $line = $line[$this->line] ?? '';
37 37
         if ($line) {
38
-            $terms  = call_user_func_array(
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
 
Please login to merge, or discard this patch.