承接 decodelabs/nuance 相关项目开发

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

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

decodelabs/nuance

Composer 安装命令:

composer require decodelabs/nuance

包简介

Type inspection tools

README 文档

README

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

Type inspection tools

Nuance provides a comprehensive suite of inspection and entity rendering tools to allow for deep data structure dumping functionality.

Installation

This package requires PHP 8.4 or higher.

Install via Composer:

composer require decodelabs/nuance

Usage

This library is intended to be integrated into larger debug tools - it is the heart of the inspection and rendering functionality, but does not provide a user interface by itself. See Glitch to use Nuance in a user-friendly way.

Load a Renderer and pass a value - Nuance will inspect it and any nested values and return a string representation of the value in the format denoted by the Renderer:

use DecodeLabs\Nuance\Renderer\Html as HtmlRenderer;

$renderer = new HtmlRenderer();
$value = ['foo' => 'bar', 'baz' => ['qux' => 'quux']];
$output = $renderer->render($value);

The output from the HTML renderer is just the raw markup - it up to the implementing system to provide styles and scripts to make it presentable.

Custom dumps

It is possible to define custom dump information for your userland objects, allowing for a more tailored representation of your data structures. This is done by implementing the DecodeLabs\Nuance\Dumpable interface on your classes.

Constructing an instanceof DecodeLabs\Nuance\Entity\NativeObject will inspect the basic properties of the object and you can then add optional information to extend the dump output.

use DecodeLabs\Nuance\Dumpable;
use DecodeLabs\Nuance\Entity\NativeObject;

class MyCustomObject implements Dumpable
{
    public function toNuanceEntity(): NativeObject
    {
        $output = new NativeObject($this);

        // Custom display name - rendered as a class name
        $output->displayName = 'Custom\\Object';

        // Item name - an extension of the display name, useful for sub-types or options
        $output->itemName = 'option-1';

        // Sensitive - marks the entire object as sensitive, which will prevent
        // data within it from being displayed
        $output->sensitive = true;

        // Numerical size of the object, if applicable
        $output->length = 42;

        // Definition string
        $output->definition = '<xml>MyCustomObject</xml>';

        // Text string
        $output->text = 'My custom object text representation';

        // Intrinsic values of the object - useful for collection-like objects
        $output->values = [
            'key1' => 'value1',
            'key2' => 'value2',
        ];

        // Don't show keys from values list
        $output->valueKeys = false;

        // Shortcut to setting a single value in value list without keys
        $output->value = 'single value';

        // Properties - bona fide members of the object, manually collected
        $output->setProperty(
            name: 'property1',
            value: 'value1',
            visibility: 'protected',
            virtual: false,
            readOnly: true
        );

        // Metadata - additional information about the object
        $output->meta = [
            'created_at' => '2023-10-01',
            'updated_at' => '2023-10-02',
        ];

        // Programatically disable dump sections
        $output->sections->disable('info');

        return $output;
    }
}

Licensing

Nuance is licensed under the MIT License. See LICENSE for the full license text.

decodelabs/nuance 适用场景与选型建议

decodelabs/nuance 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 decodelabs/nuance 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 decodelabs/nuance 我们能提供哪些服务?
定制开发 / 二次开发

基于 decodelabs/nuance 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 23
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-03