mirror of
https://github.com/Respect/Validation.git
synced 2024-06-26 17:20:16 +02:00
22 lines
630 B
PHP
22 lines
630 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class AlnumException extends ValidationException
|
|
{
|
|
const INVALID_ALNUM = 'Alnum_1';
|
|
const INVALID_ALNUM_CHARS = 'Alnum_2';
|
|
public static $defaultTemplates = array(
|
|
self::INVALID_ALNUM => '"%s" does not contain only letters and digits',
|
|
self::INVALID_ALNUM_CHARS => '"%s" does not contain only letters, digits and "%s"'
|
|
);
|
|
|
|
public function chooseTemplate($input, $additionalCharacters=null)
|
|
{
|
|
if (empty($additionalCharacters))
|
|
return self::INVALID_ALNUM;
|
|
else
|
|
return self::INVALID_ALNUM_CHARS;
|
|
}
|
|
|
|
} |