Author: Manuel Lemos
Package: Armory PHP Closure Trait
This package provides a trait that can be used to quickly add callback function registration and invocation for any number of types of events that a class may trigger.
About the Armory PHP Closure Trait Package
The package Armory PHP Closure Trait is one of the few PHP packages that was considered notable recently because it does something that is worth paying attention.
The basic purpose is: Cache, rename and hide anonymous functions
Here follows in more detail what it does:
This package provides a trait to cache, rename and hide your anonymous and callback functions in a class object instance.
It provides a protected array to store the functions under a different name.
By declaring the functions as properties of the class object, getter and setter methods take care of the hiding. The executing scope is preserved.
The trait can be used to gather all callback functions and store them in a protected variable to avoid name collisions.
It can also make class functions available without the necessity of retrieving the object instances first.
Conclusion
The Armory PHP Closure Trait can be downloaded from download page or be installed using the PHP Composer tool following instructions in the Composer install instructions page.
This package was considered notable for implementing its benefits in a way that is worth noticing.
Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.
If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.
One nice prize that many PHP developers want and you may like is the PHP elePHPant mascot plush.
You need to be a registered user or login to post a comment
1,616,107 PHP developers registered to the PHP Classes site.
Be One of Us!
Login Immediately with your account on:
Comments:
No comments were submitted yet.