PHPackages                             edelprino/buildertrait - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. edelprino/buildertrait

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

edelprino/buildertrait
======================

1526PHP

Since Oct 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/edelprino/buildertrait)[ Packagist](https://packagist.org/packages/edelprino/buildertrait)[ RSS](/packages/edelprino-buildertrait/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

BuilderTrait (WIP) [![Build Status](https://camo.githubusercontent.com/9178b798fc55745ba97863618f3f2f4986a00331dde4561a1fd4415f22d1470f/68747470733a2f2f7472617669732d63692e6f72672f6564656c7072696e6f2f6275696c64657274726169742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/edelprino/buildertrait)
====================================================================================================================================================================================================================================================================================================================

[](#buildertrait-wip-)

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

[](#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
-------

[](#install)

```
composer require edelprino/buildertrait
```

Resources on Builder pattern
----------------------------

[](#resources-on-builder-pattern)

- [https://en.wikipedia.org/wiki/Builder\_pattern](https://en.wikipedia.org/wiki/Builder_pattern)

Follow me on
------------

[](#follow-me-on)

- [Twitter](http://twitter.com/edelprino)
- [GitHub](https://github.com/edelprino)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9bafac5ec527b90930da5fe99015276623f09b4fab9c2ea3e73d0932a0ca5ef?d=identicon)[edelprino](/maintainers/edelprino)

---

Top Contributors

[![edelprino](https://avatars.githubusercontent.com/u/1643514?v=4)](https://github.com/edelprino "edelprino (8 commits)")

### Embed Badge

![Health badge](/badges/edelprino-buildertrait/health.svg)

```
[![Health](https://phpackages.com/badges/edelprino-buildertrait/health.svg)](https://phpackages.com/packages/edelprino-buildertrait)
```

###  Alternatives

[velhron/dadata-bundle

DaData for Symfony

2076.6k](/packages/velhron-dadata-bundle)[phpcfdi/xml-cancelacion

Genera documentos de cancelación de CFDI firmados (XMLSEC)

1149.5k4](/packages/phpcfdi-xml-cancelacion)[pressbooks/pressbooks-aldine

Aldine is the default theme for the home page of Pressbooks networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher.

114.3k](/packages/pressbooks-pressbooks-aldine)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
