X7ROOT File Manager
Current Path:
/opt/alt/php53/usr/share/pear/Symfony/Component/Validator/Constraints
opt
/
alt
/
php53
/
usr
/
share
/
pear
/
Symfony
/
Component
/
Validator
/
Constraints
/
π
..
π
AbstractComparison.php
(1.09 KB)
π
AbstractComparisonValidator.php
(2.22 KB)
π
All.php
(1.52 KB)
π
AllValidator.php
(1.14 KB)
π
Blank.php
(511 B)
π
BlankValidator.php
(775 B)
π
Callback.php
(1.61 KB)
π
CallbackValidator.php
(2.42 KB)
π
CardScheme.php
(699 B)
π
CardSchemeValidator.php
(3.97 KB)
π
Choice.php
(1.08 KB)
π
ChoiceValidator.php
(2.87 KB)
π
Collection
π
Collection.php
(2.73 KB)
π
CollectionValidator.php
(2.14 KB)
π
Count.php
(1.48 KB)
π
CountValidator.php
(1.82 KB)
π
Country.php
(520 B)
π
CountryValidator.php
(1.25 KB)
π
Currency.php
(522 B)
π
CurrencyValidator.php
(1.25 KB)
π
Date.php
(514 B)
π
DateTime.php
(522 B)
π
DateTimeValidator.php
(510 B)
π
DateValidator.php
(1.25 KB)
π
Email.php
(584 B)
π
EmailValidator.php
(1.98 KB)
π
EqualTo.php
(489 B)
π
EqualToValidator.php
(588 B)
π
Existence.php
(559 B)
π
Expression.php
(1.07 KB)
π
ExpressionValidator.php
(2.45 KB)
π
False.php
(511 B)
π
FalseValidator.php
(797 B)
π
File.php
(1.53 KB)
π
FileValidator.php
(6.11 KB)
π
GreaterThan.php
(497 B)
π
GreaterThanOrEqual.php
(516 B)
π
GreaterThanOrEqualValidator.php
(631 B)
π
GreaterThanValidator.php
(610 B)
π
GroupSequence.php
(630 B)
π
GroupSequenceProvider.php
(399 B)
π
Iban.php
(479 B)
π
IbanValidator.php
(1.92 KB)
π
IdenticalTo.php
(523 B)
π
IdenticalToValidator.php
(598 B)
π
Image.php
(1.91 KB)
π
ImageValidator.php
(5.64 KB)
π
Ip.php
(1.99 KB)
π
IpValidator.php
(2.64 KB)
π
Isbn.php
(1.29 KB)
π
IsbnValidator.php
(2.86 KB)
π
Issn.php
(578 B)
π
IssnValidator.php
(1.8 KB)
π
Language.php
(522 B)
π
LanguageValidator.php
(1.25 KB)
π
Length.php
(1.54 KB)
π
LengthValidator.php
(2.21 KB)
π
LessThan.php
(491 B)
π
LessThanOrEqual.php
(510 B)
π
LessThanOrEqualValidator.php
(625 B)
π
LessThanValidator.php
(604 B)
π
Locale.php
(518 B)
π
LocaleValidator.php
(1.24 KB)
π
Luhn.php
(476 B)
π
LuhnValidator.php
(1.9 KB)
π
NotBlank.php
(518 B)
π
NotBlankValidator.php
(766 B)
π
NotEqualTo.php
(496 B)
π
NotEqualToValidator.php
(597 B)
π
NotIdenticalTo.php
(530 B)
π
NotIdenticalToValidator.php
(604 B)
π
NotNull.php
(516 B)
π
NotNullValidator.php
(728 B)
π
Null.php
(509 B)
π
NullValidator.php
(929 B)
π
Optional.php
(404 B)
π
Range.php
(1.06 KB)
π
RangeValidator.php
(1.38 KB)
π
Regex.php
(2.39 KB)
π
RegexValidator.php
(1.24 KB)
π
Required.php
(404 B)
π
Time.php
(514 B)
π
TimeValidator.php
(1.21 KB)
π
True.php
(509 B)
π
TrueValidator.php
(821 B)
π
Type.php
(774 B)
π
TypeValidator.php
(1.39 KB)
π
Url.php
(560 B)
π
UrlValidator.php
(3.59 KB)
π
Valid.php
(907 B)
Editing: IssnValidator.php
<?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\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * Validates whether the value is a valid ISSN. * * @author Antonio J. GarcΓa Lagar <aj@garcialagar.es> * * @see https://en.wikipedia.org/wiki/Issn */ class IssnValidator extends ConstraintValidator { /** * {@inheritDoc} */ public function validate($value, Constraint $constraint) { if (null === $value || '' === $value) { return; } if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) { throw new UnexpectedTypeException($value, 'string'); } // Compose regex pattern $digitsPattern = $constraint->requireHyphen ? '\d{4}-\d{3}' : '\d{4}-?\d{3}'; $checksumPattern = $constraint->caseSensitive ? '[\d|X]' : '[\d|X|x]'; $pattern = "/^".$digitsPattern.$checksumPattern."$/"; if (!preg_match($pattern, $value)) { $this->context->addViolation($constraint->message); } else { $digits = str_split(strtoupper(str_replace('-', '', $value))); $sum = 0; for ($i = 8; $i > 1; $i--) { $sum += $i * (int) array_shift($digits); } $checksum = 'X' == reset($digits) ? 10 : (int) reset($digits); if (0 != ($sum + $checksum) % 11) { $this->context->addViolation($constraint->message); } } } }
Upload File
Create Folder