From f3da8b12076000258c33678837dd7bd5f7b3ab70 Mon Sep 17 00:00:00 2001 From: Supian M Date: Thu, 28 Nov 2024 12:42:32 +0800 Subject: [PATCH] Support PHP 8.4 --- .github/workflows/tests.yml | 2 +- src/Services/SlugService.php | 4 ++-- src/Sluggable.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d944af..05e5fe7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2, 8.3] + php: [8.2, 8.3, 8.4] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} diff --git a/src/Services/SlugService.php b/src/Services/SlugService.php index 093dae6..534e099 100644 --- a/src/Services/SlugService.php +++ b/src/Services/SlugService.php @@ -76,7 +76,7 @@ public function getConfiguration(array $overrides = []): array * * @return null|string */ - public function buildSlug(string $attribute, array $config, bool $force = null): ?string + public function buildSlug(string $attribute, array $config, bool $force = false): ?string { $slug = $this->model->getAttribute($attribute); @@ -407,7 +407,7 @@ protected function usesSoftDeleting(): bool * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ - public static function createSlug($model, string $attribute, string $fromString, array $config = null): string + public static function createSlug($model, string $attribute, string $fromString, ?array $config = null): string { if (is_string($model)) { $model = new $model; diff --git a/src/Sluggable.php b/src/Sluggable.php index 9f65bff..1ff6354 100644 --- a/src/Sluggable.php +++ b/src/Sluggable.php @@ -45,7 +45,7 @@ public static function slugged($callback): void /** * @inheritDoc */ - public function replicate(array $except = null) + public function replicate(?array $except = null) { $instance = parent::replicate($except); (new SlugService())->slug($instance, true);