# give/4.18.0/src/DonationForms/Rules/Concerns/HasExemptAmounts.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 54 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/DonationForms/Rules/Concerns/HasExemptAmounts.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/DonationForms/Rules/Concerns/HasExemptAmounts.php
- Modified: 2026-09-03T18:44:10+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.18.0/code/src/DonationForms/Rules/Concerns/HasExemptAmounts.php#L10-L20`.

```php
<?php

namespace Give\DonationForms\Rules\Concerns;

use function in_array;
use function is_numeric;

/**
 * Amounts an admin configured on the donation amount block, such as the donation levels or the fixed set
 * price. The custom amount minimum and maximum only constrain what a donor types into the custom amount
 * input, so those amounts are always accepted.
 *
 * @since 4.16.8
 */
trait HasExemptAmounts
{
    /**
     * @since 4.16.8
     *
     * @var float[]
     */
    protected $exemptAmounts = [];

    /**
     * @since 4.16.8
     */
    public function exemptAmounts(float ...$amounts): self
    {
        $this->exemptAmounts = $amounts;

        return $this;
    }

    /**
     * @since 4.16.8
     *
     * @return float[]
     */
    public function getExemptAmounts(): array
    {
        return $this->exemptAmounts;
    }

    /**
     * @since 4.16.8
     *
     * @param mixed $value
     */
    protected function isExemptAmount($value): bool
    {
        return is_numeric($value) && in_array((float)$value, $this->exemptAmounts, true);
    }
}

```
