承接 phpnomad/mutator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpnomad/mutator

最新稳定版本:1.0.1

Composer 安装命令:

composer require phpnomad/mutator

包简介

README 文档

README

Latest Version Total Downloads PHP Version License

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

composer require phpnomad/mutator

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

Full package documentation, including individual interface references and the adapter workflow walkthrough, lives at phpnomad.com.

License

MIT. See LICENSE.txt.

统计信息

  • 总下载量: 5.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固