Passed
Pull Request — master (#3)
by Robin
03:27 queued 44s
created
src/helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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--) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                     }
72 72
                     $code = array_filter(array_slice($lines, $start, $end - $start + 1, true), 'trim');
73 73
                     $max = strlen($end);
74
-                    $cite->code = implode("\n", array_map(function ($u, $v) use ($max) {
74
+                    $cite->code = implode("\n", array_map(function($u, $v) use ($max) {
75 75
                         return sprintf("%{$max}d\t%s", $u, rtrim($v));
76 76
                     }, array_keys($code), $code));
77 77
                     $cite->save();
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 if (!function_exists('sweep')) {
89 89
     function sweep()
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.cite')::get()->all());
94 94
 
95
-        call_user_func_array(function ($u) {
95
+        call_user_func_array(function($u) {
96 96
             $u->sweep();
97 97
         }, config('trans-helper.model.term')::get()->all());
98 98
     }
Please login to merge, or discard this patch.
migration/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.
src/TranslationHelperServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
model/VocabCite.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.