-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[12.x] Add documentation for higher order static calls on collections #10478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
<a name="higher-order-static-calls"></a> | ||
## Higher Order Static Calls | ||
|
||
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if you’re storing class names in collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to use an actual apostrophe here 😉
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if you’re storing class names in collections. | |
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if you're storing class names in collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but we do not use you’re
we use you're
across the whole docs see:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you're not.
That's what I meant 😉
<a name="higher-order-static-calls"></a> | ||
## Higher Order Static Calls | ||
|
||
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if you’re storing class names in collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if "shortcut" isn't the more common version 🤔 but I'm not a native speaker, so 🤷🏻♂️
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if you’re storing class names in collections. | |
Collections also provide support for "higher order static calls", which are shortcuts for calling static methods elegantly if you’re storing class names in collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the same tone that we used in the section above that one, see: Higher Order Messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In dusk docs we used both shortcuts
and short-cuts
, so I will open a PR to unify that across the docks.
Thank you for this.
I dunno if we really need to document this at the moment. Thanks though! |
Description
This PR adds documentation for the newly introduced support for "higher order static calls" on collections, see: laravel/framework/pull/55880.
Higher order static calls allow developers to call static methods on class names stored within a collection using a clean and expressive syntax, similar to existing "higher order messages" for instance methods.
An example is included to demonstrate how this feature can be used with a collection of transformer classes.
This complements the existing section on "higher order messages" and helps developers understand and take advantage of this new feature when working with collections of class names.