Skip to content

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

With first-class callables now allowed in attributes since PHP 8.5, it might become more common to find named closures in exported objects.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

LGTM, but I have a question about naming.


Is it something we could leverage for dumping object-bound closures in the DIC? Like #61656. But we don't serialize objects in DI arguments anyway, so it's probably a bad idea.


#[\Attribute(\Attribute::TARGET_CLASS)]
#[PrivateFCC(self::testMethod(...))]
class PrivateFCC
Copy link
Member

Choose a reason for hiding this comment

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

What's the meaning of FCC?

Copy link
Member Author

Choose a reason for hiding this comment

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

first-class callables ;)

@nicolas-grekas
Copy link
Member Author

I wouldn't add that to general DI values yet. The closure() function will allow it anyway, properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants