PHP code example of run_as_root / business-metrics-report

1. Go to this page and download the library: Download run_as_root/business-metrics-report library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

run_as_root / business-metrics-report example snippets


getMetricCode(): string       // unique identifier
getMetricLabel(): string      // human-readable label
getSortOrder(): int           // display order (lower = first)
collect(DateTimeInterface $start, DateTimeInterface $end): MetricResultInterface
xml
<type name="RunAsRoot\BusinessMetricsReport\Channel\Slack\NotificationChannel">
    <arguments>
        <argument name="formatters" xsi:type="array">
            <item name="monthly" xsi:type="object">Vendor\Module\Channel\Slack\Formatter\MonthlyFormatter</item>
        </argument>
    </arguments>
</type>
<type name="RunAsRoot\BusinessMetricsReport\Channel\Slack\SummaryMessageBuilder">
    <arguments>
        <argument name="titles" xsi:type="array">
            <item name="monthly" xsi:type="string">📊 Monthly Business Metrics Report</item>
        </argument>
    </arguments>
</type>
xml
<type name="RunAsRoot\BusinessMetricsReport\Channel\Email\NotificationChannel">
    <arguments>
        <argument name="formatters" xsi:type="array">
            <item name="monthly" xsi:type="object">Vendor\Module\Channel\Email\Formatter\MonthlyFormatter</item>
        </argument>
    </arguments>
</type>