You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, a Laravel Job is as barebones as it gets since none of the methods or properties on the job are required. I think you can even use public function __invoke() instead of public function handle() which is the only condition that exists.
The issue here is that a lot of properties are not typehinted in the IDE since there is nothing documented for them inside the code. I'd like to propose a docblock typehint for these since it makes working with these functionalities much easier. All these properties are tested at runtime using method_exists($job, 'someMethod') or $job->someProp ?? 0 and do not seem to be in any trait or contract/interface:
Sadly, the \Illuminate\Contracts\Queue\Job interface is already in use, so I am looking for an alternative. If anyone has a better idea on how to provide support for this, please post below.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, a Laravel Job is as barebones as it gets since none of the methods or properties on the job are required. I think you can even use
public function __invoke()
instead ofpublic function handle()
which is the only condition that exists.The issue here is that a lot of properties are not typehinted in the IDE since there is nothing documented for them inside the code. I'd like to propose a docblock typehint for these since it makes working with these functionalities much easier. All these properties are tested at runtime using
method_exists($job, 'someMethod')
or$job->someProp ?? 0
and do not seem to be in any trait or contract/interface:Sadly, the
\Illuminate\Contracts\Queue\Job
interface is already in use, so I am looking for an alternative. If anyone has a better idea on how to provide support for this, please post below.Beta Was this translation helpful? Give feedback.
All reactions