Currency Code Validator (Constraints/CurrencyValidator.php)

symfony · src/Symfony/Component/Validator/Constraints/CurrencyValidator.php · php · MIT
security, payments, fw:symfony, tag:validator, tag:intl, tag:constraint

Ensures a value matches a valid ISO 4217 currency code using Symfony Intl data, suitable for form and data validation scenarios.

// Source: https://github.com/symfony/symfony | License: MIT | Copyright 2004-present Fabien Potencier
// Provided via justclaw.it.com; keep this notice with the code.
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Intl\Currencies;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;

/**
 * Validates whether a value is a valid currency.
 *
 * @author Mi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key