Skip to content
项目

关于

提供对 PHP 对象图进行实用操作的功能。

数据与分析

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

sebastian/object-graph

Minimum PHP Version Latest Stable Version CI Status Code Coverage

Provides useful operations on PHP object graphs.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require sebastian/object-graph

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev sebastian/object-graph

Usage

Object Graph Visualization with GraphViz

<?php declare(strict_types=1);
use function SebastianBergmann\ObjectGraph\object_graph_dump;

$cart = new ShoppingCart;
$cart->add(new ShoppingCartItem('Foo', new Money(123, new Currency('EUR')), 1));
$cart->add(new ShoppingCartItem('Bar', new Money(456, new Currency('EUR')), 1));

object_graph_dump('graph.png', $cart);

Screenshot

The object_graph_dump() function supports the DOT Graph Description Language (.dot), Portable Document Format (.pdf), Portable Network Graphics (.png), and Scalable Vector Graphics (.svg) output formats.

The generation of PDF, PNG, and SVG files requires the GraphViz dot binary to be on the $PATH.

探索相关项目

加载中…