Passed
Pull Request — master (#2)
by Gordon
04:44
created
tests/SluggableHelperTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\Sluggable\Tests;
4 4
 
Please login to merge, or discard this patch.
tests/Model/SluggestTestObject.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     private static $table_name = 'Test_SluggableObject';
12 12
 
13 13
     private static $db= [
14
-      'DisplayName' => 'Varchar',
14
+        'DisplayName' => 'Varchar',
15 15
     ];
16 16
 
17 17
     private static $extensions = [
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\Sluggable\Tests\Model;
4 4
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     private static $table_name = 'Test_SluggableObject';
12 12
 
13
-    private static $db= [
13
+    private static $db = [
14 14
       'DisplayName' => 'Varchar',
15 15
     ];
16 16
 
Please login to merge, or discard this patch.
tests/SluggableObjectTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\Sluggable\Tests;
4 4
 
Please login to merge, or discard this patch.
src/Helper/SluggableHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\Sluggable\Helper;
4 4
 
Please login to merge, or discard this patch.
src/Extension/Sluggable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\Sluggable\Extension;
4 4
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     private static $indexes = [
18 18
         'SlugIndex' => [
19 19
             'type' => 'unique',
20
-            'columns' => ['Slug'],
20
+            'columns' => [ 'Slug' ],
21 21
         ],
22 22
     ];
23 23
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         /** @var string $slug */
45 45
         $slug = $helper->getSlug($fieldValue);
46
-        $count = $this->getOwner()->get()->filter([$fieldName => $fieldValue])->count();
46
+        $count = $this->getOwner()->get()->filter([ $fieldName => $fieldValue ])->count();
47 47
 
48 48
         if ($count >= 1) {
49 49
             $i = 0;
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
             while ($i < 1000) {
53 53
                 $suffix = $i === 0
54 54
                     ? ''
55
-                    : '-' . $i;
56
-                $slugToSave = $slug . $suffix;
55
+                    : '-'.$i;
56
+                $slugToSave = $slug.$suffix;
57 57
 
58
-                $existing = $this->getOwner()->get()->filter(['Slug' => $slugToSave])->first();
58
+                $existing = $this->getOwner()->get()->filter([ 'Slug' => $slugToSave ])->first();
59 59
                 if (!isset($existing)) {
60 60
                     $this->getOwner()->Slug = $slugToSave;
61 61
 
Please login to merge, or discard this patch.