Skip to content

[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

Closed
wants to merge 1 commit into from

Conversation

AhmedAlaa4611
Copy link
Contributor

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.

<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.
Copy link
Contributor

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 😉

Suggested change
Collections also provide support for "higher order static calls", which are short-cuts for calling static methods elegantly if youre 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.
Copy link
Contributor

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 🤷🏻‍♂️

Suggested change
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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@taylorotwell
Copy link
Member

I dunno if we really need to document this at the moment. Thanks though!

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.

3 participants