When dispatching a job via MyJobClass::dispatch($arg)
the linter flags a problem stating Too many arguments
which is kind of correct because the dispatch function doesn't have any arguments to it but it uses ...func_get_args()
to process arguments, so the code is correct but still gets flagged.
trait Dispatchable
{
/**
* Dispatch the job with the given arguments.
*
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public static function dispatch()
{
return new PendingDispatch(new static(...func_get_args()));
}
Any workarounds for this?