# give/4.16.9/src/TestData/Addons/Funds/ServiceProvider.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 44 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/TestData/Addons/Funds/ServiceProvider.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/TestData/Addons/Funds/ServiceProvider.php
- Modified: 2021-11-23T23:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/TestData/Addons/Funds/ServiceProvider.php#L10-L20`.

```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;
            }
        );
    }
}

```
