Skip to content

Commit bf82c01

Browse files
committed
fix: incorrect default prefix class name
1 parent f6e16d7 commit bf82c01

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

config/sqids.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@
7878
|
7979
*/
8080

81-
'prefix_class' => \RedExplosion\Sqids\Prefixes\ConstantPrefix::class,
81+
'prefix_class' => \RedExplosion\Sqids\Prefixes\ConsonantPrefix::class,
8282

8383
];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
use Illuminate\Support\Str;
99
use RedExplosion\Sqids\Contracts\Prefix;
1010

11-
class ConstantPrefix implements Prefix
11+
class ConsonantPrefix implements Prefix
1212
{
1313
/**
14-
* Use the first 3 constants as the model prefix.
14+
* Use the first 3 consonants as the model prefix.
1515
*
1616
* @param class-string<Model> $model
1717
* @return string

tests/Prefixes/ConstantPrefixTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
declare(strict_types=1);
44

5-
use RedExplosion\Sqids\Prefixes\ConstantPrefix;
5+
use RedExplosion\Sqids\Prefixes\ConsonantPrefix;
66
use Workbench\App\Models\Charge;
77
use Workbench\App\Models\Customer;
88

99
it(description: 'can generate a prefix without vowels', closure: function (): void {
10-
expect(new ConstantPrefix())
10+
expect(new ConsonantPrefix())
1111
->prefix(model: Customer::class)
1212
->toBe(expected: 'cst')
1313
->prefix(model: Charge::class)

tests/Support/ConfigTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
use RedExplosion\Sqids\Prefixes\ConstantPrefix;
5+
use RedExplosion\Sqids\Prefixes\ConsonantPrefix;
66
use RedExplosion\Sqids\Prefixes\SimplePrefix;
77
use RedExplosion\Sqids\Support\Config;
88

@@ -55,7 +55,7 @@
5555
});
5656

5757
it('can get the prefix class', function (): void {
58-
expect(Config::prefixClass())->toBeInstanceOf(ConstantPrefix::class);
58+
expect(Config::prefixClass())->toBeInstanceOf(ConsonantPrefix::class);
5959

6060
config()->set('sqids.prefix_class', SimplePrefix::class);
6161

0 commit comments

Comments
 (0)