Skip to content

About

Binding snapshots and diagnostics for Ray.Di.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Ray.Bindings

Binding snapshots and diagnostics for Ray.Di.

codecov Type Coverage Continuous Integration

Installation

composer require --dev ray/bindings

Binding snapshots

Collect a module after its bindings have been composed:

use Ray\Bindings\Bindings;

$bindings = new Bindings();
$module->accept($bindings);

$markdown = $bindings->toMarkdown();
$html = $bindings->toHtml($composerLock, 'prod-app', $vendorDir);

The snapshot contains the resolved bindings, module composition, pointcuts and binding provenance at the time accept() is called. Later module changes do not mutate an existing snapshot; visiting another module replaces it.

HTML renderer

Ray.Di 2.23+ writes bindings.md into the injector's directory at composition time. Render that file as a standalone HTML page:

vendor/bin/bindings-html bindings.md composer.lock prod-app > bindings.html

Object graph

Pass a Graphviz DOT of the module to show the object graph above the bindings. The browser lays it out, so no Graphviz binary is needed. Generate the DOT with ray/object-visual-grapher:

use Ray\ObjectGrapher\ObjectGrapher;

$dot = (new ObjectGrapher())($module);
$html = $bindings->toHtml($composerLock, 'prod-app', $vendorDir, $dot);
vendor/bin/bindings-html bindings.md composer.lock prod-app graph.dot > bindings.html

bindings.html: object graph, summary, and binding list

About

Binding snapshots and diagnostics for Ray.Di.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages