@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Suilven\Sluggable\Tests; |
| 4 | 4 | |
@@ -11,7 +11,7 @@ |
||
| 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 = [ |
@@ -1,4 +1,4 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Suilven\Sluggable\Tests; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Suilven\Sluggable\Helper; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |