mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
720 B
720 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| You can use generic class-string annotations to hint that an instance of the passed class is returned | 1479467944581033986 | weekly-thread-2021-01 | freekmurze |
|
2022-01-07T15:00:19+00:00 | you-can-use-generic-class-string-annotations-to-hint-that-an-instance-of-the-passed-class-is-returned |
This is how you can hint that a function returns an instance of the class of which you passed the class name.
Cool stuff!
Hat tip to @enunomaduro
7fa88922aa/src/PendingRoutes/PendingRouteAction.php (L100-L107)