PHPackages                             mawebdk/to-string-builder - 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. mawebdk/to-string-builder

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

mawebdk/to-string-builder
=========================

Builder class for \_\_toString() methods.

2.0.1(8mo ago)032BSD-2-ClausePHPPHP ^8.3.6

Since Sep 2Pushed 8mo agoCompare

[ Source](https://github.com/mawebdk/to-string-builder)[ Packagist](https://packagist.org/packages/mawebdk/to-string-builder)[ RSS](/packages/mawebdk-to-string-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (2)

ToStringBuilder
===============

[](#tostringbuilder)

Builder class for \_\_toString() methods.

Usage
-----

[](#usage)

Sample usage in a \_\_toString() method:

```
public function __toString(): string
{
    $toStringBuilder = new ToStringBuilder(object: $this);

    return $toStringBuilder
        ->add('firstname', $this->firstname)
        ->add('lastname', $this->lastname)
        ->add('age', $this->age)
        ->build();
    }
}

```

Sample output:

```
Namespace\Classname{"firstname": "John", "lastname": "Doe", "age": 18}

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance60

Regular maintenance activity

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

256d ago

Major Versions

1.0.0 → 2.0.02025-09-04

### Community

Maintainers

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

---

Top Contributors

[![mawebdk](https://avatars.githubusercontent.com/u/176606063?v=4)](https://github.com/mawebdk "mawebdk (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mawebdk-to-string-builder/health.svg)

```
[![Health](https://phpackages.com/badges/mawebdk-to-string-builder/health.svg)](https://phpackages.com/packages/mawebdk-to-string-builder)
```

###  Alternatives

[acirtautas/oxid-module-internals

OXID eShop module system helper tools

274.5k](/packages/acirtautas-oxid-module-internals)

PHPackages © 2026

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