Download the PHP package phpnomad/mutator without Composer
On this page you can find all versions of the php package phpnomad/mutator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mutator
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
Overview
The package exports five interfaces and one trait:
Mutatoris the stateful transformation contract. An implementation holds input in its own state and exposes a singlemutate(): voidcall that produces a result internally.MutatorHandleris the functional counterpart. Itsmutate(...$args)takes arguments and returns a result directly, with no instance state to manage.MutationAdapterhandles bidirectional conversion between raw data andMutatorinstances, keeping data marshaling separate from transformation logic.MutationStrategyattaches handler factories to named actions, enabling dynamic dispatch and deferred instantiation through acallable():MutatorHandlergetter.HasMutationslets an object advertise the mutations it supports viagetMutations(): array, which is useful when you want capabilities to be discoverable at runtime.CanMutateFromAdapteris a trait that runs the full convert, mutate, convert workflow in a singlemutate(...$args)call on any class that holds aMutationAdapterproperty.
Documentation
Full package documentation, including individual interface references and the adapter workflow walkthrough, lives at phpnomad.com.
License
MIT. See LICENSE.txt.