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
All this to say, it should be possible to specialize the return type instead of just returning BaseData so that AssignmentSettingsData was used from the start. DataEloquentCast is both vendor code and presents a use-case where the get type is too broad.
#1437 is a related, slightly different, issue I saw in the backlog. Ideally we can have out-of-the-box laravel-data support to encourage strict typing in PHP projects.
Steps To Reproduce:
See #1701 - also happy to do something here upon request.
The text was updated successfully, but these errors were encountered:
Versions:
Description:
I'm using spatie/laravel-data and have code along the lines of...
php artisan ide-helper:models
results in doc-blocks along the lines of:\Spatie\LaravelData\Contracts\BaseData $settings
because
ModelsCommand
seesinstead of the class I'm actually casting to (i.e.
AssignmentSettingsData
):All this to say, it should be possible to specialize the return type instead of just returning
BaseData
so thatAssignmentSettingsData
was used from the start.DataEloquentCast
is both vendor code and presents a use-case where theget
type is too broad.#1437 is a related, slightly different, issue I saw in the backlog. Ideally we can have out-of-the-box
laravel-data
support to encourage strict typing in PHP projects.Steps To Reproduce:
See #1701 - also happy to do something here upon request.
The text was updated successfully, but these errors were encountered: