From 361a4b2a6b591287e3084fb91e60efde75834d49 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 28 Nov 2024 14:05:16 +1300 Subject: [PATCH 1/2] API Explicity mark nullable parameters for PHP 8.4 --- src/DataDifferencer.php | 2 +- src/Versioned.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DataDifferencer.php b/src/DataDifferencer.php index b216cc31..771a2ee6 100644 --- a/src/DataDifferencer.php +++ b/src/DataDifferencer.php @@ -59,7 +59,7 @@ class DataDifferencer extends ModelData * @param DataObject $fromRecord * @param DataObject $toRecord */ - public function __construct(DataObject $fromRecord = null, DataObject $toRecord = null) + public function __construct(?DataObject $fromRecord = null, ?DataObject $toRecord = null) { $this->fromRecord = $fromRecord; $this->toRecord = $toRecord; diff --git a/src/Versioned.php b/src/Versioned.php index f4e56f9e..c53178a6 100644 --- a/src/Versioned.php +++ b/src/Versioned.php @@ -454,7 +454,7 @@ protected function updateInheritableQueryParams(&$params) * @param DataQuery|null $dataQuery * @throws InvalidArgumentException */ - protected function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) + protected function augmentSQL(SQLSelect $query, ?DataQuery $dataQuery = null) { if (!$dataQuery) { return; @@ -895,7 +895,7 @@ protected function isTableVersioned($table) * @param DataQuery $dataQuery * @param DataObject $dataObject */ - protected function augmentLoadLazyFields(SQLSelect &$query, DataQuery &$dataQuery = null, $dataObject) + protected function augmentLoadLazyFields(SQLSelect &$query, ?DataQuery &$dataQuery = null, $dataObject) { // The VersionedMode local variable ensures that this decorator only applies to // queries that have originated from the Versioned object, and have the Versioned From 5ff41a231c167df2aa99544aeac31e4ac0add04a Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Sun, 1 Dec 2024 20:19:02 +1300 Subject: [PATCH 2/2] API Make parameter non-optional for PHP 8.4 --- src/Versioned.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Versioned.php b/src/Versioned.php index c53178a6..e4701c59 100644 --- a/src/Versioned.php +++ b/src/Versioned.php @@ -895,7 +895,7 @@ protected function isTableVersioned($table) * @param DataQuery $dataQuery * @param DataObject $dataObject */ - protected function augmentLoadLazyFields(SQLSelect &$query, ?DataQuery &$dataQuery = null, $dataObject) + protected function augmentLoadLazyFields(SQLSelect &$query, ?DataQuery &$dataQuery, $dataObject) { // The VersionedMode local variable ensures that this decorator only applies to // queries that have originated from the Versioned object, and have the Versioned