diff --git a/src/Strings.php b/src/Strings.php index a732a80..1d7f761 100644 --- a/src/Strings.php +++ b/src/Strings.php @@ -321,12 +321,12 @@ public function random(int $length = 64, string $keyspace = '0123456789abcdefghi /** * Add's _1 to a string or increment the ending number to allow _2, _3, etc. * - * @param int $first Start with * @param string $separator Separator + * @param int $first Start with * * @return self Returns instance of The Strings class. */ - public function increment(int $first = 1, string $separator = '_'): self + public function increment(string $separator = '_', int $first = 1): self { preg_match('/(.+)' . $separator . '([0-9]+)$/', $this->string, $match); diff --git a/tests/StringsTest.php b/tests/StringsTest.php index e389709..866ded7 100644 --- a/tests/StringsTest.php +++ b/tests/StringsTest.php @@ -76,8 +76,8 @@ test('test increment() method', function (): void { $this->assertEquals('page_2', Strings::create('page_1')->increment()); - $this->assertEquals('page_3', Strings::create('page')->increment(3)); - $this->assertEquals('page-3', Strings::create('page')->increment(3, '-')); + $this->assertEquals('page_3', Strings::create('page')->increment('_', 3)); + $this->assertEquals('page-3', Strings::create('page')->increment('-', 3)); });