PHPackages                             jclaveau/php-fluent-trait - 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. jclaveau/php-fluent-trait

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

jclaveau/php-fluent-trait
=========================

Traits gathering fluent syntax common methods

1.4.0(2w ago)04.2k↓100%[5 issues](https://github.com/jclaveau/php-fluent-traits/issues)MITPHPPHP &gt;=8.0CI passing

Since Nov 3Pushed 2w ago1 watchersCompare

[ Source](https://github.com/jclaveau/php-fluent-traits)[ Packagist](https://packagist.org/packages/jclaveau/php-fluent-trait)[ RSS](/packages/jclaveau-php-fluent-trait/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (9)Used By (0)

PHP Fluent Traits
=================

[](#php-fluent-traits)

These traits gather some commons methods of classes implementing fluent syntax.

Quality
-------

[](#quality)

[![CI](https://github.com/jclaveau/php-fluent-traits/actions/workflows/tests.yml/badge.svg)](https://github.com/jclaveau/php-fluent-traits/actions/workflows/tests.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/421446474ce3fbee2cf183dc6863d21b470a7b72f9d7070520c55ac3005d8044/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a636c61766561752f7068702d666c75656e742d74726169742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jclaveau/php-fluent-trait/?branch=master)

Installation
------------

[](#installation)

php-fluent-traits is installable via [Composer](http://getcomposer.org)

```
composer require jclaveau/php-fluent-traits

```

Usage
-----

[](#usage)

```
class FluentObject
{
    use JClaveau\Traits\Fluent\New_;
    use JClaveau\Traits\Fluent\Clone_;
    use JClaveau\Traits\Fluent\DefineAs;
    use JClaveau\Traits\Fluent\DefineCloneAs;
    use JClaveau\Traits\Fluent\Dump;

    protected $name;

    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }
}

$instance = FluentObject::new_()
    ->setName('Foo')
    ->dump()                // FluentObject #1 Foo
    ->defineAs($fooObject1)
    ->clone_()
    ->dump()                // FluentObject #2 Foo
    ->defineCloneAs($barObject2)
    ->setName('Bar')
    ->dump()                // FluentObject #2 Bar
    ;

$fooObject1->dump(); // FluentObject #1 Foo
$barObject2->dump(); // FluentObject #3 Foo
$instance->dump();   // FluentObject #2 Bar
```

###  Health Score

52

—

FairBetter than 97% of packages

Maintenance96

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~578 days

Total

5

Last Release

17d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

1.4.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

[![jclaveau](https://avatars.githubusercontent.com/u/1556489?v=4)](https://github.com/jclaveau "jclaveau (17 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (1 commits)")

---

Tags

clonefluenttraitschainedinstance

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jclaveau-php-fluent-trait/health.svg)

```
[![Health](https://phpackages.com/badges/jclaveau-php-fluent-trait/health.svg)](https://phpackages.com/packages/jclaveau-php-fluent-trait)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k836.4M141](/packages/myclabs-deep-copy)[symfony/var-exporter

Allows exporting any serializable PHP data structure to plain PHP code

2.1k369.3M334](/packages/symfony-var-exporter)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28555.3k3](/packages/samrap-acf-fluent)[verbb/cloner

Easily clone sections, entry types, groups and more.

25177.4k](/packages/verbb-cloner)[prevailexcel/laravel-action-service-trait

A simple Laravel package to create actions, traits and services using artisan commands

142.7k](/packages/prevailexcel-laravel-action-service-trait)

PHPackages © 2026

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