edelprino / buildertrait
Installs: 526
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/edelprino/buildertrait
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is not auto-updated.
Last update: 2022-12-28 11:44:22 UTC
README
If you want to create a builder but you don't want to duplicate or write with... methods.
BuilderTrait\With create automatically with... method based on property of the builder object.
Example
class AnObjectBuilder { use With; private $foo; public function buildAnObject() { return new AnObject($this->foo); } } $builder = new AnObjectBuilder(); $anObject = $builder->withFoo('bar')->buildAnObject();
##TODO
-
Withtrait for addwith...methods based on builder properties -
Buildtrait for createbuildmethod based on getter/setter of object to create
Install
composer require edelprino/buildertrait