ProviderContract.php
5 years ago
RandomAmount.php
5 years ago
RandomAuthor.php
5 years ago
RandomCurrency.php
5 years ago
RandomDonation.php
5 years ago
RandomDonationForm.php
5 years ago
RandomDonationStatus.php
5 years ago
RandomDonor.php
5 years ago
RandomGateway.php
5 years ago
RandomGoal.php
5 years ago
RandomLogCategory.php
5 years ago
RandomLogType.php
5 years ago
RandomPaymentMode.php
5 years ago
RandomProvider.php
5 years ago
RandomCurrency.php
21 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\TestData\Framework\Provider; |
| 4 | |
| 5 | class RandomCurrency extends RandomProvider { |
| 6 | |
| 7 | /** @var array [currencyCode, ... ] */ |
| 8 | protected $currencies = [ |
| 9 | 'EUR', |
| 10 | 'CAD', |
| 11 | 'USD', |
| 12 | ]; |
| 13 | |
| 14 | public function __invoke() { |
| 15 | $count = count( $this->currencies ); |
| 16 | $index = $this->faker->biasedNumberBetween( 0, $count - 1, $function = 'sqrt' ); |
| 17 | |
| 18 | return $this->currencies[ $index ]; |
| 19 | } |
| 20 | } |
| 21 |