PHPackages                             phpnomad/mutator - 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. [Framework](/categories/framework)
4. /
5. phpnomad/mutator

ActiveLibrary[Framework](/categories/framework)

phpnomad/mutator
================

1.0.1(3w ago)05.6k↓14.3%[1 issues](https://github.com/phpnomad/mutator/issues)[1 PRs](https://github.com/phpnomad/mutator/pulls)2MITPHPCI passing

Since Nov 18Pushed 3w ago2 watchersCompare

[ Source](https://github.com/phpnomad/mutator)[ Packagist](https://packagist.org/packages/phpnomad/mutator)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-mutator/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (8)Used By (2)

phpnomad/mutator
================

[](#phpnomadmutator)

[![Latest Version](https://camo.githubusercontent.com/7eb0281d977e7fb16f5c95a1055127c8da633104b13709e70892856bcc8e82ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f6d757461746f722e737667)](https://packagist.org/packages/phpnomad/mutator)[![Total Downloads](https://camo.githubusercontent.com/a8f4e9538333a897fad6ffc55dc75c1ae6d54c3138503a362ad3431fa85a84fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f6d757461746f722e737667)](https://packagist.org/packages/phpnomad/mutator)[![PHP Version](https://camo.githubusercontent.com/63e86453ee4188d7c6d05f6c1b7dc0e4610991c17505981f8305c7bac8a2e482/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f6d757461746f722e737667)](https://packagist.org/packages/phpnomad/mutator)[![License](https://camo.githubusercontent.com/d85c8a6a6d66ddd40c8c767c453b0dfb1672fcab8e71d8939533178c90f6d8a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f6d757461746f722e737667)](https://packagist.org/packages/phpnomad/mutator)

`phpnomad/mutator` provides interfaces and a trait for structured data transformation. Instead of scattering one-off transformation helpers across your codebase, you define mutators that follow a consistent contract and route input through them via adapters. The package has no runtime dependencies and is used by other PHPNomad packages, including `phpnomad/loader`, to handle transformation steps in a testable, composable way.

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

[](#installation)

```
composer require phpnomad/mutator
```

Overview
--------

[](#overview)

The package exports five interfaces and one trait:

- `Mutator` is the stateful transformation contract. An implementation holds input in its own state and exposes a single `mutate(): void` call that produces a result internally.
- `MutatorHandler` is the functional counterpart. Its `mutate(...$args)` takes arguments and returns a result directly, with no instance state to manage.
- `MutationAdapter` handles bidirectional conversion between raw data and `Mutator` instances, keeping data marshaling separate from transformation logic.
- `MutationStrategy` attaches handler factories to named actions, enabling dynamic dispatch and deferred instantiation through a `callable():MutatorHandler` getter.
- `HasMutations` lets an object advertise the mutations it supports via `getMutations(): array`, which is useful when you want capabilities to be discoverable at runtime.
- `CanMutateFromAdapter` is a trait that runs the full convert, mutate, convert workflow in a single `mutate(...$args)` call on any class that holds a `MutationAdapter` property.

Documentation
-------------

[](#documentation)

Full package documentation, including individual interface references and the adapter workflow walkthrough, lives at [phpnomad.com](https://phpnomad.com).

License
-------

[](#license)

MIT. See [LICENSE.txt](LICENSE.txt).

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance95

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.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 ~540 days

Total

2

Last Release

21d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (14 commits)")[![malayladu](https://avatars.githubusercontent.com/u/708174?v=4)](https://github.com/malayladu "malayladu (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

frameworkmutatorphpphpnomadplatform-agnostictransformation

### Embed Badge

![Health badge](/badges/phpnomad-mutator/health.svg)

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

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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