HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/public_html/wp-content/plugins/give/src/TestData/Addons/Funds/ServiceProvider.php
<?php

namespace Give\TestData\Addons\Funds;

use Give\ServiceProviders\ServiceProvider as GiveServiceProvider;
use WP_CLI;

/**
 * Class ServiceProvider
 * @package Give\TestData\Funds
 */
class ServiceProvider implements GiveServiceProvider
{
    /**
     * @inheritDoc
     */
    public function register()
    {
    }

    /**
     * @inheritDoc
     */
    public function boot()
    {
        // Add CLI commands
        if (defined('WP_CLI') && WP_CLI) {
            WP_CLI::add_command('give test-funds', give()->make(FundCommand::class));
        }

        /**
         * Inject Fund ID into revenue data
         */
        add_filter(
            'give-test-data-revenue-definition',
            function ($args) {
                $args['fund_id'] = give(FundFactory::class)->getRandomFund();

                return $args;
            }
        );
    }
}