From ab7087010ec5e6017370a1a3a78c1b08c70ca254 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:01:28 +0000 Subject: [PATCH 1/2] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/markdown-normalize.yml | 2 +- .github/workflows/pint.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/update-changelog.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/markdown-normalize.yml b/.github/workflows/markdown-normalize.yml index 4c0c537..1672101 100644 --- a/.github/workflows/markdown-normalize.yml +++ b/.github/workflows/markdown-normalize.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 21fc250..9f9386a 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 ref: ${{ github.head_ref }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index edf132b..9e20cb6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 2a44c47..1ae2822 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main From e2ad531673236b34cc5e899f4829a8a373487082 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 4 Sep 2023 14:01:58 +0000 Subject: [PATCH 2/2] PHP Linting (Pint) --- src/Contracts/Generator.php | 2 +- src/Contracts/HumanKeys.php | 2 +- src/Generators/KsuidGenerator.php | 2 +- src/Generators/SnowflakeGenerator.php | 2 +- src/HumanKeys.php | 2 +- tests/Fixture/Models/PostWithUuid.php | 2 +- tests/Unit/GeneratorFactoryTest.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Contracts/Generator.php b/src/Contracts/Generator.php index de227ca..7e61380 100644 --- a/src/Contracts/Generator.php +++ b/src/Contracts/Generator.php @@ -6,5 +6,5 @@ interface Generator { - public function generate(?string $prefix = null): string; + public function generate(string $prefix = null): string; } diff --git a/src/Contracts/HumanKeys.php b/src/Contracts/HumanKeys.php index 7fbca48..7fe3fc8 100644 --- a/src/Contracts/HumanKeys.php +++ b/src/Contracts/HumanKeys.php @@ -6,5 +6,5 @@ interface HumanKeys { - public function generate(?string $prefix = null): string; + public function generate(string $prefix = null): string; } diff --git a/src/Generators/KsuidGenerator.php b/src/Generators/KsuidGenerator.php index f21b2c8..6d49bc5 100644 --- a/src/Generators/KsuidGenerator.php +++ b/src/Generators/KsuidGenerator.php @@ -9,7 +9,7 @@ class KsuidGenerator implements Generator { - public function generate(?string $prefix = null): string + public function generate(string $prefix = null): string { return implode('_', [ $prefix, diff --git a/src/Generators/SnowflakeGenerator.php b/src/Generators/SnowflakeGenerator.php index 9664e78..5b8597c 100644 --- a/src/Generators/SnowflakeGenerator.php +++ b/src/Generators/SnowflakeGenerator.php @@ -9,7 +9,7 @@ class SnowflakeGenerator implements Generator { - public function generate(?string $prefix = null): string + public function generate(string $prefix = null): string { return implode('_', [ $prefix, diff --git a/src/HumanKeys.php b/src/HumanKeys.php index 351d9ba..e468af2 100755 --- a/src/HumanKeys.php +++ b/src/HumanKeys.php @@ -11,7 +11,7 @@ public function __construct(protected string $generator) { } - public function generate(?string $prefix = null): string + public function generate(string $prefix = null): string { return GeneratorFactory::make($this->generator)->generator()->generate($prefix); } diff --git a/tests/Fixture/Models/PostWithUuid.php b/tests/Fixture/Models/PostWithUuid.php index af55ac1..4a7f72a 100644 --- a/tests/Fixture/Models/PostWithUuid.php +++ b/tests/Fixture/Models/PostWithUuid.php @@ -10,8 +10,8 @@ class PostWithUuid extends Model { - use HasUuids; use HasHumanKey; + use HasUuids; protected $table = 'posts_with_uuid'; diff --git a/tests/Unit/GeneratorFactoryTest.php b/tests/Unit/GeneratorFactoryTest.php index a858c5b..2ecc384 100644 --- a/tests/Unit/GeneratorFactoryTest.php +++ b/tests/Unit/GeneratorFactoryTest.php @@ -18,7 +18,7 @@ test('custom generators can be used', function () { $generator = new class implements GeneratorContract { - public function generate(?string $prefix = null): string + public function generate(string $prefix = null): string { return "{$prefix}_foo"; }