macro
Customize code using closures (by aimeos)
macroable
A trait to dynamically add methods to a class (by spatie)
macro | macroable | |
---|---|---|
2 | 2 | |
1,036 | 669 | |
- | 0.7% | |
4.2 | 2.8 | |
6 months ago | about 1 month ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
macro
Posts with mentions or reviews of macro.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-12-08.
-
PHP Macro - Dynamically extend PHP objects
If you have a look at the PHP Marcoable trait, you can see that there's no magic involved. Basically, only the __call() method is used to catch unknown method calls and see if there's a registered macro with that name.
macroable
Posts with mentions or reviews of macroable.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-12-08.
-
PHP Macro - Dynamically extend PHP objects
What's the difference with https://github.com/spatie/macroable ?
-
[RFC] Deprecate dynamic properties has passed!
It makes it harder to extend classes without using inheritance and DI. For example any macros you add with https://github.com/spatie/macroable now can't save any data to the class you are extending, which was useful under some circumstances. The only workaround I can think of would involve some horrible hack involving globals and spl_object_hash.
What are some alternatives?
When comparing macro and macroable you can also consider the following projects:
alma - ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
laravel-collection-macros - A set of useful Laravel collection macros
UniFi-API-client - A PHP API client class to interact with Ubiquiti's UniFi Controller API
Laravel-Zero - A PHP framework for console artisans
laravel-database-mail-templates - Render Laravel mailables based on a mail template stored in the database
PHPT - The PHP Interpreter
serializable-closure - Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
Rector - Instant Upgrades and Automated Refactoring of any PHP 5.3+ code