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.
class AnObjectBuilder
{
use With;
private $foo;
public function buildAnObject()
{
return new AnObject($this->foo);
}
}
$builder = new AnObjectBuilder();
$anObject = $builder->withFoo('bar')->buildAnObject();
##TODO
-
With
trait for addwith...
methods based on builder properties -
Build
trait for createbuild
method based on getter/setter of object to create
composer require edelprino/buildertrait