diff --git a/docs/advanced-usage/batch-logs.md b/docs/advanced-usage/batch-logs.md index f048edd2..5080d65d 100644 --- a/docs/advanced-usage/batch-logs.md +++ b/docs/advanced-usage/batch-logs.md @@ -127,7 +127,7 @@ Activity::forBatch($uuid)->get(); // all the activity that happend in the batch ```php class SomeJob { - public function handle(string $value, string $batchUuid = null) + public function handle(string $value, ?string $batchUuid = null) { LogBatch::startBatch(); if($batchUuid) LogBatch::setBatch($batchUuid); diff --git a/src/ActivityLogger.php b/src/ActivityLogger.php index 0b93f1d3..451d3ea6 100644 --- a/src/ActivityLogger.php +++ b/src/ActivityLogger.php @@ -133,7 +133,7 @@ public function inLog(?string $logName): static return $this->useLog($logName); } - public function tap(callable $callback, string $eventName = null): static + public function tap(callable $callback, ?string $eventName = null): static { call_user_func($callback, $this->getActivity(), $eventName); diff --git a/src/helpers.php b/src/helpers.php index 1e10717d..d9338013 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -4,7 +4,7 @@ use Spatie\Activitylog\ActivityLogStatus; if (! function_exists('activity')) { - function activity(string $logName = null): ActivityLogger + function activity(?string $logName = null): ActivityLogger { $defaultLogName = config('activitylog.default_log_name');