Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

edelprino/buildertrait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Example

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 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

Follow me on

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published