owen-it / laravel-auditing

Record the change log from models in Laravel
https://laravel-auditing.com
MIT License
3.01k stars 387 forks source link

Update return value of Auditor->execute so that it works for PHP Version 8.1.19 #838

Closed weirdlooop closed 1 year ago

weirdlooop commented 1 year ago

This error is returned if return type void is not provided using PHP Version > 8.1.19:

Declaration of OwenIt\Auditing\Auditor::execute(OwenIt\Auditing\Contracts\Auditable $model) must be compatible with OwenIt\Auditing\Contracts\Auditor::execute(OwenIt\Auditing\Contracts\Auditable $model): void

jgrandar commented 1 year ago

Similar problem with PHP 8.2.6, got: local.ERROR: Declaration of OwenIt\Auditing\Auditable::auditDetach(string $relationName, $ids = null, $touch = true) must be compatible with App\Models\BaseModel::auditDetach($relationName, $ids) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Declaration of OwenIt\Auditing\Auditable::auditDetach(string $relationName, $ids = null, $touch = true) must be compatible with App\Models\BaseModel::auditDetach($relationName, $ids) at /usr/share/nginx/html/vendor/owen-it/laravel-auditing/src/Auditable.php:674) [stacktrace]