Skip to content

Latest commit

 

History

History
38 lines (35 loc) · 1.45 KB

File metadata and controls

38 lines (35 loc) · 1.45 KB

1. Usage

1.1. What are statistics?

Statistics are additional information about a class/object, that will be displayed in the var_dump output in the key __statistics.

1.2. Use statistics

#[AddStatistic(PropertyCount::class)]
class Test
{
    use ModifiedDump;

    private $a;
}

To use multiple statistics, just use multiple AddStatistic attributes.

2. Custom statistics

2.1. Create the statistic

Statistics have to implement the interface \Berbeflo\ModifyDump\Statistic\Statistic, which defines the methods createStatistic, which returns the statistic data and getStatisticIdentifier, which returns the array key to be used for the statistic.
It also defines the method create which must return the filter instance.

2.2. Use the statistic

Pass the full qualified class name of the statistic class to the #[AddStatistic] attribute.

3. Implemented statistics

PropertyCount

Shows the number of properties, defined in the class

4. Navigation