Download the PHP package pajarotin/compose without Composer
On this page you can find all versions of the php package pajarotin/compose. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download pajarotin/compose
More information about pajarotin/compose
Files in pajarotin/compose
Download pajarotin/compose
More information about pajarotin/compose
Files in pajarotin/compose
Vendor pajarotin
Package compose
Short Description Compose - A tool for class/trait creation, in a 'Frankenstein way', for PHP
License MIT
Homepage https://github.com/pajarotin/Compose
Package compose
Short Description Compose - A tool for class/trait creation, in a 'Frankenstein way', for PHP
License MIT
Homepage https://github.com/pajarotin/Compose
Please rate this library. Is it a good library?
Informations about the package compose
Compose – A tool for class/trait creation, in a "Frankenstein way", for PHP
Features
- Flag composed class as abstract
- Flag composed class as final
- Set composed class/trait namespace
- Set composed class base class
- Add/Remove interface to composed class
- Add/Remove trait to composed class/trait
- Add/Remove constant to composed class
- Add/Remove property to composed class/trait
- Add/Remove method to composed class/trait
- Add donor class properties and methods to composed class/trait
- Add donor trait properties and methods to composed class/trait
- Add donor class interfaces, traits, constants, properties and methods to composed class
- Add donor class constant to composed class
- Deferred composed class/trait compilation (evaluation of composed code), linked to php autoload system
- Deferred composed class/trait build (configuration of composed class and), linked to php autoload system
- Update constant before compilation
- Update property before compilation
- Update method before compilation
- ¡ FULLY EXPERIMENTAL CODE !
"Favor composition over inheritance"
This tool allows composing a class or a trait by code, with chunks of previous classes or traits
- constants can be added or copied from a previous class (only to a class)
- properties can be added or copied from a previous class or trait
- methods can be added or copied from a previous class or trait
- traits can be added or copied from a previous class
- interfaces can be added or copied from a previous class (only to a class)
- Before compilation any part can be removed
- Before compilation constants and properties can also be updated
These features can be used to automate changes to third parties source code, without resorting to editing it directly.
License
This software is distributed under the [MIT] license. Please read LICENSE for information on the software availability and distribution.
Example
Changelog
See changelog.
Issues
- EXPERIMENTAL CODE, NOT RECOMMENDED FOR PRODUCTION
- Composition is completely "textual", chunks of source code lines are copied to generate composed code
- Using the same donor classes namespace is recommended for better source code compatibility
- Copied source code can break if it uses FILE, DIR or uses its donor class name
- Extraction of functions source code is not very wise. Adding a Closure as method fails if the closure is inlined as argument of addMethod. Must be defined as shown:
All versions of compose with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4.0
The package pajarotin/compose contains the following files
Loading the files please wait ....