# give/4.16.9/src/TestData/Framework/Provider/RandomCurrency.php

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

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

```php
<?php

namespace Give\TestData\Framework\Provider;

class RandomCurrency extends RandomProvider
{

    /** @var array [currencyCode, ... ] */
    protected $currencies = [
        'EUR',
        'CAD',
        'USD',
    ];

    public function __invoke()
    {
        $count = count($this->currencies);
        $index = $this->faker->biasedNumberBetween(0, $count - 1, $function = 'sqrt');

        return $this->currencies[$index];
    }
}

```
