From 620021a5a4cdbc92c78ff0fd35dea556e015e4bf Mon Sep 17 00:00:00 2001 From: chillbram Date: Fri, 4 Sep 2026 21:38:03 +0200 Subject: [PATCH] Fix implicit nullable types This behavior has been been [deprecated since PHP 8.4](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types). This has no impact on the rest of the code. This does not seem to be a breaking change as PHP already internally converts the method signature from e.g. `callable` to `?callable` when it detects an implicitly nullable parameter. Therefore, the method signatures are "the same" and code that overrides these methods is not affected. --- src/Models/Entity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Models/Entity.php b/src/Models/Entity.php index ba96bc3..c87a7b7 100644 --- a/src/Models/Entity.php +++ b/src/Models/Entity.php @@ -1573,7 +1573,7 @@ public function getSiblingsRange($from, $to = null, array $columns = ['*']) * * @return Builder */ - private function buildSiblingQuery(Builder $builder, $id, callable $positionCallback = null) + private function buildSiblingQuery(Builder $builder, $id, ?callable $positionCallback = null) { $parentIdColumn = $this->getParentIdColumn(); $positionColumn = $this->getPositionColumn(); @@ -1759,12 +1759,12 @@ public static function getTreeByQuery(Builder $query, array $columns = ['*']) * Saves models from the given attributes array. * * @param array $tree - * @param EntityInterface $parent + * @param EntityInterface|null $parent * * @return Collection * @throws Throwable */ - public static function createFromArray(array $tree, EntityInterface $parent = null) + public static function createFromArray(array $tree, ?EntityInterface $parent = null) { $entities = [];