-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
PHP 8.4 has deprecated implicitly nullable parameters. In previous versions, writing array $transformers = null was valid, but now PHP requires an explicit nullable type declaration using ?.
Error:
PHP Deprecated: {closure:Algolia\ScoutExtended\ScoutExtendedServiceProvider::registerMacros():128}(): Implicitly marking parameter $transformers as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/algolia/scout-extended/src/ScoutExtendedServiceProvider.php on line 128
Fix:
Algolia\ScoutExtended\ScoutExtendedServiceProvider:L126
\Illuminate\Database\Eloquent\Builder::macro('transform', function (array $array, ?array $transformers = null) {
foreach ($transformers ?? UpdateJob::getTransformers() as $transformer) {
$array = app($transformer)->transform($this->getModel(), $array);
}
return $array;
});This should fix the issue and makes the package fully compatible with the latest php version. Let me know if I should make a PR for this change :-)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels