Skip to content

Conversation

@petrknap
Copy link
Contributor

Based on the silence at #55080 I guess the correct smallest data type from implementation. Based on observation and method Illuminate\Database\Query\Builder::find I changed Illuminate\Queue\Jobs\DatabaseJob::getJobId to string|int and based on all implementations of Illuminate\Queue\Jobs\Job::getJobId in this repository I changed its return type to string|int|null (as DB job returns stdClass::$id, both should be mixed).

Benefit to end users - this version will not lead to fatal errors (if other annotations are correct).

Children MUST respect it's parent. You can't expand parents return type in it's children, you only can make the children return more specific, for more information visit https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming).

…and `Illuminate\Queue\Jobs\DatabaseJob::getJobId()` methods

#55080
@taylorotwell taylorotwell merged commit 9bf2d35 into laravel:12.x Mar 22, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants