Passed
Push — master ( 0bc4e9...f28d10 )
by Vasyl
02:26
created
src/HasSlugMaker.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
      */
33 33
     protected static function bootHasSlugMaker()
34 34
     {
35
-        static::created(function (Model $model) {
35
+        static::created(function(Model $model) {
36 36
             $model->generateSlugOnCreate();
37 37
         });
38 38
 
39
-        static::updated(function (Model $model) {
39
+        static::updated(function(Model $model) {
40 40
             $model->generateSlugOnUpdate();
41 41
         });
42 42
 
43
-        static::deleted(function (Model $model) {
43
+        static::deleted(function(Model $model) {
44 44
             $model->removeSlugsOnDeleted();
45 45
         });
46 46
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $this->slugOptions = $this->getSlugMakerOptions();
54 54
 
55
-        if (! $this->slugOptions->generateSlugsOnCreate) {
55
+        if (!$this->slugOptions->generateSlugsOnCreate) {
56 56
             return;
57 57
         }
58 58
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $this->slugOptions = $this->getSlugMakerOptions();
69 69
         $this->currentSlugModel = $this->slug;
70 70
 
71
-        if (! $this->slugOptions->generateSlugsOnUpdate) {
71
+        if (!$this->slugOptions->generateSlugsOnUpdate) {
72 72
             return;
73 73
         }
74 74
 
Please login to merge, or discard this patch.
src/SlugHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             ->byNamesByClass($slugs, $modelClass)
50 50
             ->get();
51 51
 
52
-        return $slugs->map(function ($item) {
52
+        return $slugs->map(function($item) {
53 53
             return $item->slugable;
54 54
         });
55 55
     }
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
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('slug_get_model')) {
3
+if (!function_exists('slug_get_model')) {
4 4
     function slug_get_model($slug, $class = null)
5 5
     {
6 6
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModel($slug, $class);
7 7
     }
8 8
 }
9 9
 
10
-if (! function_exists('slug_get_models')) {
10
+if (!function_exists('slug_get_models')) {
11 11
     function slug_get_models($slugs, $class = null)
12 12
     {
13 13
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModels($slugs, $class);
14 14
     }
15 15
 }
16 16
 
17
-if (! function_exists('slug_get_id')) {
17
+if (!function_exists('slug_get_id')) {
18 18
     function slug_get_id($slug, $class = null)
19 19
     {
20 20
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->getId($slug, $class);
21 21
     }
22 22
 }
23 23
 
24
-if (! function_exists('slug_get_ids')) {
24
+if (!function_exists('slug_get_ids')) {
25 25
     function slug_get_ids($slugs, $class = null)
26 26
     {
27 27
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIds($slugs, $class);
28 28
     }
29 29
 }
30 30
 
31
-if (! function_exists('slug_get_grouped_class')) {
31
+if (!function_exists('slug_get_grouped_class')) {
32 32
     function slug_get_grouped_class($attributes, $useId = false)
33 33
     {
34 34
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIdsGroupedByClass($attributes, $useId);
35 35
     }
36 36
 }
37 37
 
38
-if (! function_exists('slug_make')) {
38
+if (!function_exists('slug_make')) {
39 39
     function slug_make($model, $slug)
40 40
     {
41 41
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->makeForModel($model, $slug);
42 42
     }
43 43
 }
44 44
 
45
-if (! function_exists('slug_delete')) {
45
+if (!function_exists('slug_delete')) {
46 46
     function slug_delete($model)
47 47
     {
48 48
         return app(\Fomvasss\SlugMaker\SlugHelper::class)->deleteByModel($model);
Please login to merge, or discard this patch.
src/ServiceTraits/SlugGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         $slugSourceString = collect($this->slugOptions->generateSlugFrom)
49
-            ->map(function (string $fieldName) : string {
49
+            ->map(function(string $fieldName) : string {
50 50
                 return $this->$fieldName ?? '';
51 51
             })
52 52
             ->implode('-');
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     protected function guardAgainstInvalidSlugOptions()
109 109
     {
110
-        if (! count($this->slugOptions->generateSlugFrom)) {
110
+        if (!count($this->slugOptions->generateSlugFrom)) {
111 111
             throw InvalidOption::missingFromField();
112 112
         }
113 113
 
Please login to merge, or discard this patch.
src/ServiceTraits/SlugScopes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     {
36 36
         $slugs = is_array($slug) ? $slug : [$slug];
37 37
 
38
-        return $query->whereHas('slug', function ($q) use ($slugs) {
38
+        return $query->whereHas('slug', function($q) use ($slugs) {
39 39
             $q->whereIn('name', $slugs);
40 40
         });
41 41
     }
Please login to merge, or discard this patch.
src/Models/SlugModelScopesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
     public function scopeByClassesByNames($query, array $attributes, $key = 'name')
8 8
     {
9 9
         foreach ($attributes as $type => $slugs) {
10
-            if (! empty($slugs)) {
10
+            if (!empty($slugs)) {
11 11
                 $names = is_array($slugs) ? $slugs : [$slugs];
12 12
                 $query->orWhere('slugable_type', $type)->whereIn($key, $names);
13 13
             }
Please login to merge, or discard this patch.
src/SlugMakerServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
             __DIR__.'/../config/slugmaker.php' => $this->app->configPath().'/slugmaker.php',
14 14
         ], 'config');
15 15
 
16
-        if (! class_exists('CreateSlugsTable')) {
16
+        if (!class_exists('CreateSlugsTable')) {
17 17
             $timestamp = date('Y_m_d_His', time());
18 18
 
19 19
             $this->publishes([
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function register()
31 31
     {
32
-        $this->app->bind(SlugHelper::class, function () {
32
+        $this->app->bind(SlugHelper::class, function() {
33 33
             return new SlugHelper(new Slug());
34 34
         });
35 35
     }
Please login to merge, or discard this patch.