Skip to content

Commit

Permalink
fix: add explicit nullable type for additionalQuery parameter
Browse files Browse the repository at this point in the history
Add explicit nullable type declaration for $additionalQuery parameter in findBySlug method to address PHP 8.4 deprecation warning
  • Loading branch information
RomkaLTU authored Dec 22, 2024
1 parent 65fe98e commit 0ebb170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected function generateSubstring($slugSourceString)
return substr($slugSourceString, 0, $this->slugOptions->maximumLength);
}

public static function findBySlug(string $slug, array $columns = ['*'], callable $additionalQuery = null)
public static function findBySlug(string $slug, array $columns = ['*'], ?callable $additionalQuery = null)
{
$modelInstance = new static();
$field = $modelInstance->getSlugOptions()->slugField;
Expand Down

0 comments on commit 0ebb170

Please sign in to comment.