2017 © Pedro PelĂĄez
 

library buildertrait

image

edelprino/buildertrait

  • Friday, October 14, 2016
  • by edelprino
  • Repository
  • 1 Watchers
  • 1 Stars
  • 516 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

BuilderTrait (WIP) Build Status

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., (*1)

Example

class AnObjectBuilder
{
    use With;

    private $foo;

    public function buildAnObject()
    {
        return new AnObject($this->foo);
    }
}

$builder = new AnObjectBuilder();
$anObject = $builder->withFoo('bar')->buildAnObject();

TODO

  • [x] With trait for add with... methods based on builder properties
  • [ ] Build trait for create build method based on getter/setter of object to create

Install

composer require edelprino/buildertrait

Resources on Builder pattern

  • https://en.wikipedia.org/wiki/Builder_pattern

Follow me on

The Versions

14/10 2016

dev-master

9999999-dev

  Sources   Download

The Development Requires

by Ettore Delprino