PHPackages                             decodelabs/nuance - 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. decodelabs/nuance

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

decodelabs/nuance
=================

Type inspection tools

v0.2.2(7mo ago)05.7k20MITPHPPHP ^8.4CI passing

Since Jun 6Pushed 5mo agoCompare

[ Source](https://github.com/decodelabs/nuance)[ Packagist](https://packagist.org/packages/decodelabs/nuance)[ RSS](/packages/decodelabs-nuance/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (15)Used By (20)

Nuance
======

[](#nuance)

[![PHP from Packagist](https://camo.githubusercontent.com/e92fab62d02a6101b7807e7859dd1d65d0cc89f8f6b75edef6d850b19cda0054/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f64656c6162732f6e75616e63653f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/nuance)[![Latest Version](https://camo.githubusercontent.com/e2c447130d41a536b3cc890d36179155a6520c4ac917f3878597d6eccc297082/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f64656c6162732f6e75616e63652e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/nuance)[![Total Downloads](https://camo.githubusercontent.com/8b5da9367275b1b6f66272fd0a4409eb2ad442bba0343d62573c58266ac19684/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f64656c6162732f6e75616e63652e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/nuance)[![GitHub Workflow Status](https://camo.githubusercontent.com/1062f5e98fdbf3ea018b9a5804ecd73ac3b6361ab83768e6d3938e801f4d644f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f64656c6162732f6e75616e63652f696e746567726174652e796d6c3f6272616e63683d646576656c6f70)](https://github.com/decodelabs/nuance/actions/workflows/integrate.yml)[![PHPStan](https://camo.githubusercontent.com/e25c14ce011edabdd0fbd2e10415b41cc5d66ed11ef3e5b7edd074c5bdd35a2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d3434434331312e7376673f6c6f6e6743616368653d74727565267374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/c6b762995b277fb083aca955d7dd07b3f44a9d370e06b5a61b08516a9cbc859e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465636f64656c6162732f6e75616e63653f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/nuance)

### Type inspection tools

[](#type-inspection-tools)

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

---

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

[](#installation)

This package requires PHP 8.4 or higher.

Install via Composer:

```
composer require decodelabs/nuance
```

Usage
-----

[](#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](https://github.com/decodelabs/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
------------

[](#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 = 'MyCustomObject';

        // 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
---------

[](#licensing)

Nuance is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance67

Regular maintenance activity

Popularity20

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~10 days

Recently: every ~20 days

Total

13

Last Release

223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a241d64d12b3b5ee94197862ec1ec30b82ed2efa34a0cd7f4c3565a021daddd?d=identicon)[betterthanclay](/maintainers/betterthanclay)

---

Top Contributors

[![betterthanclay](https://avatars.githubusercontent.com/u/1273586?v=4)](https://github.com/betterthanclay "betterthanclay (45 commits)")

### Embed Badge

![Health badge](/badges/decodelabs-nuance/health.svg)

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

PHPackages © 2026

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