# give/4.16.9/src/TestData/Commands/DonationStatusCommand.php

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

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/TestData/Commands/DonationStatusCommand.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/TestData/Commands/DonationStatusCommand.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/Commands/DonationStatusCommand.php#L10-L20`.

```php
<?php

namespace Give\TestData\Commands;

use WP_CLI;

/**
 * Class DonationStatusCommand
 * @package Give\TestData\Commands
 *
 * A WP-CLI command to get all donation statuses available
 */
class DonationStatusCommand
{
    /**
     * Get available donation statuses
     *
     * ## EXAMPLES
     *
     *     wp give test-donation-statuses
     *
     * @when after_wp_load
     */
    public function __invoke($args, $assocArgs)
    {
        // Get donation statuses
        $statuses = give_get_payment_statuses();

        $formatted = [];

        foreach ($statuses as $status => $name) {
            $formatted[] = [
                'Name' => $name,
                'Status' => $status,
            ];
        }

        WP_CLI\Utils\format_items(
            'table',
            $formatted,
            ['Name', 'Status']
        );
    }
}

```
