Passed
Push — master ( ca5e33...a928bb )
by Robin
03:01
created
src/model/VocabCite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         if ($line) {
39 39
             foreach ($this->terms()->get() as $term) {
40 40
                 $keywords = ["localize('{$term->term}')", 'localize("' . $term->term . '")'];
41
-                $matched = array_filter(array_map(function ($u) use ($line) {
41
+                $matched = array_filter(array_map(function($u) use ($line) {
42 42
                     return strpos($line, $u);
43 43
                 }, $keywords), 'strlen');
44 44
                 if (empty($matched)) {
Please login to merge, or discard this patch.
src/migration/2019_03_10_110221_create_queue_tables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             if (!Schema::connection($connection)->hasTable(config('queue.failed.table'))) {
19 19
                 Schema::connection($connection)->create(
20 20
                     config('queue.failed.table'),
21
-                    function (Blueprint $table) {
21
+                    function(Blueprint $table) {
22 22
                         $table->bigIncrements('id');
23 23
                         $table->text('connection');
24 24
                         $table->text('queue');
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             if (!Schema::connection($connection)->hasTable(config('queue.connections.database.table'))) {
33 33
                 Schema::connection($connection)->create(
34 34
                     config('queue.connections.database.table'),
35
-                    function (Blueprint $table) {
35
+                    function(Blueprint $table) {
36 36
                         $table->bigIncrements('id');
37 37
                         $table->string('queue')->index();
38 38
                         $table->longText('payload');
Please login to merge, or discard this patch.
src/model/VocabTerm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
             call_user_func_array(
61 61
                 'array_merge',
62 62
                 array_map(
63
-                    function ($u) {
63
+                    function($u) {
64 64
                         return array_keys($u->translation);
65 65
                     },
66 66
                     self::get()->all()
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use TopviewDigital\TranslationHelper\Model\VocabCite;
5 5
 use TopviewDigital\TranslationHelper\Service\Translation;
6 6
 
7
-if (! function_exists('array_sort_value')) {
7
+if (!function_exists('array_sort_value')) {
8 8
     function array_sort_value($array, $mode = SORT_LOCALE_STRING)
9 9
     {
10 10
         // SORT_REGULAR - compare items normally (don't change types)
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
         // SORT_NATURAL - compare items as strings using "natural ordering" like natsort()
16 16
         // SORT_FLAG_CASE
17 17
 
18
-        if (! is_array($array)) {
19
-            $array = method_exists($array, 'toArray') ? $array->toArray() : (array) $array;
18
+        if (!is_array($array)) {
19
+            $array = method_exists($array, 'toArray') ? $array->toArray() : (array)$array;
20 20
         }
21 21
         // \Locale::setDefault(str_replace('-', '_', \App::getLocale()));
22 22
         $keys = array_keys($array);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     }
113 113
                     $code = array_filter(array_slice($lines, $start, $end - $start + 1, true), 'trim');
114 114
                     $max = strlen($end);
115
-                    $cite->code = implode("\n", array_map(function ($u, $v) use ($max) {
115
+                    $cite->code = implode("\n", array_map(function($u, $v) use ($max) {
116 116
                         return sprintf("%{$max}d    %s", $u + 1, rtrim($v));
117 117
                     }, array_keys($code), $code));
118 118
                     $cite->save();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     function sweep()
131 131
     {
132 132
         array_map(
133
-            function ($u) {
133
+            function($u) {
134 134
                 $u->sweep();
135 135
             },
136 136
             array_merge(
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     {
182 182
         $keys = array_keys($slugs);
183 183
         $slugs = array_values($slugs);
184
-        $slugs = array_map(function ($k, $v) use ($slugs) {
184
+        $slugs = array_map(function($k, $v) use ($slugs) {
185 185
             if ($k > 0 && in_array($v, array_slice($slugs, 0, $k - 1))) {
186 186
                 $v .= '-' . uniqid();
187 187
             }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                 }
227 227
                 $slugs = unique_slugs($slugs);
228 228
                 $max = intdiv(max(array_map('strlen', $slugs)) + 3, 4) * 4;
229
-                $lines = array_map(function ($u, $v) use ($max) {
229
+                $lines = array_map(function($u, $v) use ($max) {
230 230
                     $u = "'{$u}'";
231 231
                     return sprintf("    %-{$max}s => '%s',", $u, $v);
232 232
                 }, $slugs, $terms);
Please login to merge, or discard this patch.