mirror of
https://github.com/Respect/Validation.git
synced 2024-05-29 03:42:25 +02:00
Declare visibility for constants
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
aa4b111c90
commit
5d0ecabfdc
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class AlphaException extends ValidationException
|
||||
{
|
||||
const EXTRA = 1;
|
||||
public const EXTRA = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class AlwaysInvalidException extends ValidationException
|
||||
{
|
||||
const SIMPLE = 1;
|
||||
public const SIMPLE = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class AttributeException extends NestedValidationException implements NonOmissibleExceptionInterface
|
||||
{
|
||||
const NOT_PRESENT = 0;
|
||||
const INVALID = 1;
|
||||
public const NOT_PRESENT = 0;
|
||||
public const INVALID = 1;
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NOT_PRESENT => 'Attribute {{name}} must be present',
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class CreditCardException extends ValidationException
|
||||
{
|
||||
const BRANDED = 1;
|
||||
public const BRANDED = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class GroupedValidationException extends NestedValidationException
|
||||
{
|
||||
const NONE = 0;
|
||||
const SOME = 1;
|
||||
public const NONE = 0;
|
||||
public const SOME = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class IpException extends ValidationException
|
||||
{
|
||||
const STANDARD = 0;
|
||||
const NETWORK_RANGE = 1;
|
||||
public const STANDARD = 0;
|
||||
public const NETWORK_RANGE = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class KeySetException extends GroupedValidationException implements NonOmissibleExceptionInterface
|
||||
{
|
||||
const STRUCTURE = 2;
|
||||
public const STRUCTURE = 2;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class KeyValueException extends ValidationException
|
||||
{
|
||||
const COMPONENT = 1;
|
||||
public const COMPONENT = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,10 +15,10 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class LengthException extends ValidationException
|
||||
{
|
||||
const BOTH = 0;
|
||||
const LOWER = 1;
|
||||
const GREATER = 2;
|
||||
const EXACT = 3;
|
||||
public const BOTH = 0;
|
||||
public const LOWER = 1;
|
||||
public const GREATER = 2;
|
||||
public const EXACT = 3;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class MaxException extends ValidationException
|
||||
{
|
||||
const INCLUSIVE = 1;
|
||||
public const INCLUSIVE = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class MinException extends ValidationException
|
||||
{
|
||||
const INCLUSIVE = 1;
|
||||
public const INCLUSIVE = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class NotBlankException extends ValidationException
|
||||
{
|
||||
const STANDARD = 0;
|
||||
const NAMED = 1;
|
||||
public const STANDARD = 0;
|
||||
public const NAMED = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace Respect\Validation\Exceptions;
|
|||
*/
|
||||
final class NotEmptyException extends ValidationException
|
||||
{
|
||||
const STANDARD = 0;
|
||||
const NAMED = 1;
|
||||
public const STANDARD = 0;
|
||||
public const NAMED = 1;
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'The value must not be empty',
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class NotOptionalException extends ValidationException
|
||||
{
|
||||
const STANDARD = 0;
|
||||
const NAMED = 1;
|
||||
public const STANDARD = 0;
|
||||
public const NAMED = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class OptionalException extends ValidationException
|
||||
{
|
||||
const STANDARD = 0;
|
||||
const NAMED = 1;
|
||||
public const STANDARD = 0;
|
||||
public const NAMED = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -20,9 +20,9 @@ use function Respect\Stringifier\stringify;
|
|||
|
||||
class ValidationException extends InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
const MODE_DEFAULT = 1;
|
||||
const MODE_NEGATIVE = 2;
|
||||
const STANDARD = 0;
|
||||
public const MODE_DEFAULT = 1;
|
||||
public const MODE_NEGATIVE = 2;
|
||||
public const STANDARD = 0;
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} must be valid',
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Exceptions;
|
|||
|
||||
class VideoUrlException extends ValidationException
|
||||
{
|
||||
const SERVICE = 1;
|
||||
public const SERVICE = 1;
|
||||
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
|
|
|
@ -20,9 +20,9 @@ use Respect\Validation\Exceptions\ComponentException;
|
|||
*/
|
||||
class CountryCode extends AbstractRule
|
||||
{
|
||||
const ALPHA2 = 'alpha-2';
|
||||
const ALPHA3 = 'alpha-3';
|
||||
const NUMERIC = 'numeric';
|
||||
public const ALPHA2 = 'alpha-2';
|
||||
public const ALPHA3 = 'alpha-3';
|
||||
public const NUMERIC = 'numeric';
|
||||
|
||||
/**
|
||||
* @see http://download.geonames.org/export/dump/countryInfo.txt
|
||||
|
|
|
@ -17,12 +17,12 @@ use Respect\Validation\Exceptions\ComponentException;
|
|||
|
||||
class CreditCard extends AbstractRule
|
||||
{
|
||||
const AMERICAN_EXPRESS = 'American Express';
|
||||
const DINERS_CLUB = 'Diners Club';
|
||||
const DISCOVER = 'Discover';
|
||||
const JCB = 'JCB';
|
||||
const MASTERCARD = 'MasterCard';
|
||||
const VISA = 'Visa';
|
||||
public const AMERICAN_EXPRESS = 'American Express';
|
||||
public const DINERS_CLUB = 'Diners Club';
|
||||
public const DISCOVER = 'Discover';
|
||||
public const JCB = 'JCB';
|
||||
public const MASTERCARD = 'MasterCard';
|
||||
public const VISA = 'Visa';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Respect\Validation\Rules;
|
|||
|
||||
class Imei extends AbstractRule
|
||||
{
|
||||
const IMEI_SIZE = 15;
|
||||
public const IMEI_SIZE = 15;
|
||||
|
||||
/**
|
||||
* @see https://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity
|
||||
|
|
|
@ -20,8 +20,8 @@ use Respect\Validation\Exceptions\ComponentException;
|
|||
*/
|
||||
class LanguageCode extends AbstractRule
|
||||
{
|
||||
const ALPHA2 = 'alpha-2';
|
||||
const ALPHA3 = 'alpha-3';
|
||||
public const ALPHA2 = 'alpha-2';
|
||||
public const ALPHA3 = 'alpha-3';
|
||||
|
||||
/**
|
||||
* @see http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt
|
||||
|
|
|
@ -17,7 +17,7 @@ use Respect\Validation\Exceptions\ComponentException;
|
|||
|
||||
class PostalCode extends Regex
|
||||
{
|
||||
const DEFAULT_PATTERN = '/^$/';
|
||||
public const DEFAULT_PATTERN = '/^$/';
|
||||
|
||||
/**
|
||||
* @see http://download.geonames.org/export/dump/countryInfo.txt
|
||||
|
|
|
@ -21,7 +21,7 @@ use Symfony\Component\Validator\Validation;
|
|||
|
||||
class Sf extends AbstractRule
|
||||
{
|
||||
const SYMFONY_CONSTRAINT_NAMESPACE = 'Symfony\Component\Validator\Constraints\%s';
|
||||
public const SYMFONY_CONSTRAINT_NAMESPACE = 'Symfony\Component\Validator\Constraints\%s';
|
||||
public $name;
|
||||
private $constraint;
|
||||
|
||||
|
|
Loading…
Reference in a new issue