From 4785b8875de136863870dbab363f6e08ac5044a2 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 31 Oct 2024 09:49:41 -0500 Subject: [PATCH] PHP 8.4 tests --- .github/workflows/run-tests.yml | 8 +++++++- src/Events/Audited.php | 4 ++-- src/Exceptions/AuditableTransitionException.php | 2 +- tests/Unit/AuditableTest.php | 8 ++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 432d5a58..00793ebe 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 8.0, 8.1, 8.2, 8.3] + php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4] laravel: [ 11.*, 10.*, 9.*, 8.*, 7.* ] include: - laravel: 11.* @@ -38,14 +38,20 @@ jobs: php: 8.0 - laravel: 9.* php: 7.4 + - laravel: 9.* + php: 8.4 - laravel: 8.* php: 8.3 + - laravel: 8.* + php: 8.4 - laravel: 7.* php: 8.1 - laravel: 7.* php: 8.2 - laravel: 7.* php: 8.3 + - laravel: 7.* + php: 8.4 name: PHP${{ matrix.php }} - Laravel${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/src/Events/Audited.php b/src/Events/Audited.php index 1ac3ee27..ad527c71 100644 --- a/src/Events/Audited.php +++ b/src/Events/Audited.php @@ -34,9 +34,9 @@ class Audited * * @param \OwenIt\Auditing\Contracts\Auditable $model * @param \OwenIt\Auditing\Contracts\AuditDriver $driver - * @param \OwenIt\Auditing\Contracts\Audit $audit + * @param \OwenIt\Auditing\Contracts\Audit|null $audit */ - public function __construct(Auditable $model, AuditDriver $driver, Audit $audit = null) + public function __construct(Auditable $model, AuditDriver $driver, ?Audit $audit = null) { $this->model = $model; $this->driver = $driver; diff --git a/src/Exceptions/AuditableTransitionException.php b/src/Exceptions/AuditableTransitionException.php index 840067a0..bfadf980 100644 --- a/src/Exceptions/AuditableTransitionException.php +++ b/src/Exceptions/AuditableTransitionException.php @@ -16,7 +16,7 @@ class AuditableTransitionException extends AuditingException /** * {@inheritdoc} */ - public function __construct($message = '', array $incompatibilities = [], $code = 0, Throwable $previous = null) + public function __construct($message = '', array $incompatibilities = [], $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/tests/Unit/AuditableTest.php b/tests/Unit/AuditableTest.php index 4ee3e083..a9968b6a 100644 --- a/tests/Unit/AuditableTest.php +++ b/tests/Unit/AuditableTest.php @@ -488,14 +488,14 @@ public function itReturnsTheAuditData() * * @param string $guard * @param string $driver - * @param int $id - * @param string $type + * @param int|null $id + * @param string|null $type */ public function itReturnsTheAuditDataIncludingUserAttributes( string $guard, string $driver, - int $id = null, - string $type = null + ?int $id = null, + ?string $type = null ) { $this->app['config']->set('audit.user.guards', [ $guard,