diff --git a/src/EmailLexer.php b/src/EmailLexer.php index 7e660b6..0bfe86f 100644 --- a/src/EmailLexer.php +++ b/src/EmailLexer.php @@ -7,54 +7,54 @@ use Doctrine\Common\Lexer\AbstractLexer; class EmailLexer extends AbstractLexer { //ASCII values - const S_EMPTY = null; - const C_NUL = 0; - const S_HTAB = 9; - const S_LF = 10; - const S_CR = 13; - const S_SP = 32; - const EXCLAMATION = 33; - const S_DQUOTE = 34; - const NUMBER_SIGN = 35; - const DOLLAR = 36; - const PERCENTAGE = 37; - const AMPERSAND = 38; - const S_SQUOTE = 39; - const S_OPENPARENTHESIS = 40; - const S_CLOSEPARENTHESIS = 41; - const ASTERISK = 42; - const S_PLUS = 43; - const S_COMMA = 44; - const S_HYPHEN = 45; - const S_DOT = 46; - const S_SLASH = 47; - const S_COLON = 58; - const S_SEMICOLON = 59; - const S_LOWERTHAN = 60; - const S_EQUAL = 61; - const S_GREATERTHAN = 62; - const QUESTIONMARK = 63; - const S_AT = 64; - const S_OPENBRACKET = 91; - const S_BACKSLASH = 92; - const S_CLOSEBRACKET = 93; - const CARET = 94; - const S_UNDERSCORE = 95; - const S_BACKTICK = 96; - const S_OPENCURLYBRACES = 123; - const S_PIPE = 124; - const S_CLOSECURLYBRACES = 125; - const S_TILDE = 126; - const C_DEL = 127; - const INVERT_QUESTIONMARK= 168; - const INVERT_EXCLAMATION = 173; - const GENERIC = 300; - const S_IPV6TAG = 301; - const INVALID = 302; - const CRLF = 1310; - const S_DOUBLECOLON = 5858; - const ASCII_INVALID_FROM = 127; - const ASCII_INVALID_TO = 199; + public const S_EMPTY = null; + public const C_NUL = 0; + public const S_HTAB = 9; + public const S_LF = 10; + public const S_CR = 13; + public const S_SP = 32; + public const EXCLAMATION = 33; + public const S_DQUOTE = 34; + public const NUMBER_SIGN = 35; + public const DOLLAR = 36; + public const PERCENTAGE = 37; + public const AMPERSAND = 38; + public const S_SQUOTE = 39; + public const S_OPENPARENTHESIS = 40; + public const S_CLOSEPARENTHESIS = 41; + public const ASTERISK = 42; + public const S_PLUS = 43; + public const S_COMMA = 44; + public const S_HYPHEN = 45; + public const S_DOT = 46; + public const S_SLASH = 47; + public const S_COLON = 58; + public const S_SEMICOLON = 59; + public const S_LOWERTHAN = 60; + public const S_EQUAL = 61; + public const S_GREATERTHAN = 62; + public const QUESTIONMARK = 63; + public const S_AT = 64; + public const S_OPENBRACKET = 91; + public const S_BACKSLASH = 92; + public const S_CLOSEBRACKET = 93; + public const CARET = 94; + public const S_UNDERSCORE = 95; + public const S_BACKTICK = 96; + public const S_OPENCURLYBRACES = 123; + public const S_PIPE = 124; + public const S_CLOSECURLYBRACES = 125; + public const S_TILDE = 126; + public const C_DEL = 127; + public const INVERT_QUESTIONMARK= 168; + public const INVERT_EXCLAMATION = 173; + public const GENERIC = 300; + public const S_IPV6TAG = 301; + public const INVALID = 302; + public const CRLF = 1310; + public const S_DOUBLECOLON = 5858; + public const ASCII_INVALID_FROM = 127; + public const ASCII_INVALID_TO = 199; /** * US-ASCII visible characters not valid for atext (@link http://tools.ietf.org/html/rfc5322#section-3.2.3) @@ -107,11 +107,11 @@ class EmailLexer extends AbstractLexer 'ยก' => self::INVERT_EXCLAMATION, ]; - const INVALID_CHARS_REGEX = "/[^\p{S}\p{C}\p{Cc}]+/iu"; + public const INVALID_CHARS_REGEX = "/[^\p{S}\p{C}\p{Cc}]+/iu"; - const VALID_UTF8_REGEX = '/\p{Cc}+/u'; + public const VALID_UTF8_REGEX = '/\p{Cc}+/u'; - const CATCHABLE_PATTERNS = [ + public const CATCHABLE_PATTERNS = [ '[a-zA-Z]+[46]?', //ASCII and domain literal '[^\x00-\x7F]', //UTF-8 '[0-9]+', @@ -121,11 +121,11 @@ class EmailLexer extends AbstractLexer '.', ]; - const NON_CATCHABLE_PATTERNS = [ + public const NON_CATCHABLE_PATTERNS = [ '[\xA0-\xff]+', ]; - const MODIFIERS = 'iu'; + public const MODIFIERS = 'iu'; /** @var bool */ protected $hasInvalidTokens = false; diff --git a/src/EmailParser.php b/src/EmailParser.php index cf22ab0..352eae4 100644 --- a/src/EmailParser.php +++ b/src/EmailParser.php @@ -12,7 +12,7 @@ use Egulias\EmailValidator\Result\Reason\NoLocalPart; class EmailParser extends Parser { - const EMAIL_MAX_LENGTH = 254; + public const EMAIL_MAX_LENGTH = 254; /** * @var string diff --git a/src/MessageIDParser.php b/src/MessageIDParser.php index 52e4a82..b0b6720 100644 --- a/src/MessageIDParser.php +++ b/src/MessageIDParser.php @@ -13,7 +13,7 @@ use Egulias\EmailValidator\Result\Reason\NoLocalPart; class MessageIDParser extends Parser { - const EMAILID_MAX_LENGTH = 254; + public const EMAILID_MAX_LENGTH = 254; /** * @var string diff --git a/src/Parser/DomainLiteral.php b/src/Parser/DomainLiteral.php index c668bf2..e6d66d0 100644 --- a/src/Parser/DomainLiteral.php +++ b/src/Parser/DomainLiteral.php @@ -22,9 +22,9 @@ use Egulias\EmailValidator\Warning\DomainLiteral as WarningDomainLiteral; class DomainLiteral extends PartParser { - const IPV4_REGEX = '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/'; + public const IPV4_REGEX = '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/'; - const OBSOLETE_WARNINGS = [ + public const OBSOLETE_WARNINGS = [ EmailLexer::INVALID, EmailLexer::C_DEL, EmailLexer::S_LF, diff --git a/src/Parser/DomainPart.php b/src/Parser/DomainPart.php index f171740..a57f4ba 100644 --- a/src/Parser/DomainPart.php +++ b/src/Parser/DomainPart.php @@ -24,8 +24,8 @@ use Egulias\EmailValidator\Parser\DomainLiteral as DomainLiteralParser; class DomainPart extends PartParser { - const DOMAIN_MAX_LENGTH = 253; - const LABEL_MAX_LENGTH = 63; + public const DOMAIN_MAX_LENGTH = 253; + public const LABEL_MAX_LENGTH = 63; /** * @var string diff --git a/src/Parser/FoldingWhiteSpace.php b/src/Parser/FoldingWhiteSpace.php index a332963..fff6ec3 100644 --- a/src/Parser/FoldingWhiteSpace.php +++ b/src/Parser/FoldingWhiteSpace.php @@ -15,7 +15,7 @@ use Egulias\EmailValidator\Result\ValidEmail; class FoldingWhiteSpace extends PartParser { - const FWS_TYPES = [ + public const FWS_TYPES = [ EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::S_CR, diff --git a/src/Parser/LocalPart.php b/src/Parser/LocalPart.php index 5ed395c..154521b 100644 --- a/src/Parser/LocalPart.php +++ b/src/Parser/LocalPart.php @@ -15,7 +15,7 @@ use Egulias\EmailValidator\Parser\CommentStrategy\LocalComment; class LocalPart extends PartParser { - const INVALID_TOKENS = [ + public const INVALID_TOKENS = [ EmailLexer::S_COMMA => EmailLexer::S_COMMA, EmailLexer::S_CLOSEBRACKET => EmailLexer::S_CLOSEBRACKET, EmailLexer::S_OPENBRACKET => EmailLexer::S_OPENBRACKET, diff --git a/src/Result/InvalidEmail.php b/src/Result/InvalidEmail.php index 858bae4..180f4d8 100644 --- a/src/Result/InvalidEmail.php +++ b/src/Result/InvalidEmail.php @@ -6,7 +6,7 @@ use Egulias\EmailValidator\Result\Reason\Reason; class InvalidEmail implements Result { - private $token; + private $token; /** * @var Reason */ diff --git a/src/Result/Reason/CRLFAtTheEnd.php b/src/Result/Reason/CRLFAtTheEnd.php index a0b66e7..185b9eb 100644 --- a/src/Result/Reason/CRLFAtTheEnd.php +++ b/src/Result/Reason/CRLFAtTheEnd.php @@ -4,8 +4,8 @@ namespace Egulias\EmailValidator\Result\Reason; class CRLFAtTheEnd implements Reason { - const CODE = 149; - const REASON = "CRLF at the end"; + public const CODE = 149; + public const REASON = "CRLF at the end"; public function code() : int { diff --git a/src/Validation/DNSCheckValidation.php b/src/Validation/DNSCheckValidation.php index b8fd41c..9989aa4 100644 --- a/src/Validation/DNSCheckValidation.php +++ b/src/Validation/DNSCheckValidation.php @@ -21,7 +21,7 @@ class DNSCheckValidation implements EmailValidation * Reserved Top Level DNS Names (https://tools.ietf.org/html/rfc2606#section-2), * mDNS and private DNS Namespaces (https://tools.ietf.org/html/rfc6762#appendix-G) */ - const RESERVED_DNS_TOP_LEVEL_NAMES = [ + public const RESERVED_DNS_TOP_LEVEL_NAMES = [ // Reserved Top Level DNS Names 'test', 'example', diff --git a/src/Validation/MultipleValidationWithAnd.php b/src/Validation/MultipleValidationWithAnd.php index 90d4f0d..abafe75 100644 --- a/src/Validation/MultipleValidationWithAnd.php +++ b/src/Validation/MultipleValidationWithAnd.php @@ -13,13 +13,13 @@ class MultipleValidationWithAnd implements EmailValidation * If one of validations fails, the remaining validations will be skipped. * This means MultipleErrors will only contain a single error, the first found. */ - const STOP_ON_ERROR = 0; + public const STOP_ON_ERROR = 0; /** * All of validations will be invoked even if one of them got failure. * So MultipleErrors will contain all causes. */ - const ALLOW_ALL_ERRORS = 1; + public const ALLOW_ALL_ERRORS = 1; /** * @var EmailValidation[] diff --git a/src/Warning/AddressLiteral.php b/src/Warning/AddressLiteral.php index 77e70f7..474ff0e 100644 --- a/src/Warning/AddressLiteral.php +++ b/src/Warning/AddressLiteral.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class AddressLiteral extends Warning { - const CODE = 12; + public const CODE = 12; public function __construct() { diff --git a/src/Warning/CFWSNearAt.php b/src/Warning/CFWSNearAt.php index be43bbe..8bac12b 100644 --- a/src/Warning/CFWSNearAt.php +++ b/src/Warning/CFWSNearAt.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class CFWSNearAt extends Warning { - const CODE = 49; + public const CODE = 49; public function __construct() { diff --git a/src/Warning/CFWSWithFWS.php b/src/Warning/CFWSWithFWS.php index dea3450..ba57601 100644 --- a/src/Warning/CFWSWithFWS.php +++ b/src/Warning/CFWSWithFWS.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class CFWSWithFWS extends Warning { - const CODE = 18; + public const CODE = 18; public function __construct() { diff --git a/src/Warning/Comment.php b/src/Warning/Comment.php index 704c290..6508295 100644 --- a/src/Warning/Comment.php +++ b/src/Warning/Comment.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class Comment extends Warning { - const CODE = 17; + public const CODE = 17; public function __construct() { diff --git a/src/Warning/DeprecatedComment.php b/src/Warning/DeprecatedComment.php index ad43bd7..a257807 100644 --- a/src/Warning/DeprecatedComment.php +++ b/src/Warning/DeprecatedComment.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class DeprecatedComment extends Warning { - const CODE = 37; + public const CODE = 37; public function __construct() { diff --git a/src/Warning/DomainLiteral.php b/src/Warning/DomainLiteral.php index 6f36b5e..034388c 100644 --- a/src/Warning/DomainLiteral.php +++ b/src/Warning/DomainLiteral.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class DomainLiteral extends Warning { - const CODE = 70; + public const CODE = 70; public function __construct() { diff --git a/src/Warning/EmailTooLong.php b/src/Warning/EmailTooLong.php index 497309d..d25ad12 100644 --- a/src/Warning/EmailTooLong.php +++ b/src/Warning/EmailTooLong.php @@ -6,7 +6,7 @@ use Egulias\EmailValidator\EmailParser; class EmailTooLong extends Warning { - const CODE = 66; + public const CODE = 66; public function __construct() { diff --git a/src/Warning/IPV6BadChar.php b/src/Warning/IPV6BadChar.php index ba2fcc0..3ecd5bc 100644 --- a/src/Warning/IPV6BadChar.php +++ b/src/Warning/IPV6BadChar.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6BadChar extends Warning { - const CODE = 74; + public const CODE = 74; public function __construct() { diff --git a/src/Warning/IPV6ColonEnd.php b/src/Warning/IPV6ColonEnd.php index 41afa78..3f0c2f2 100644 --- a/src/Warning/IPV6ColonEnd.php +++ b/src/Warning/IPV6ColonEnd.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6ColonEnd extends Warning { - const CODE = 77; + public const CODE = 77; public function __construct() { diff --git a/src/Warning/IPV6ColonStart.php b/src/Warning/IPV6ColonStart.php index 1bf754e..742fb3b 100644 --- a/src/Warning/IPV6ColonStart.php +++ b/src/Warning/IPV6ColonStart.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6ColonStart extends Warning { - const CODE = 76; + public const CODE = 76; public function __construct() { diff --git a/src/Warning/IPV6Deprecated.php b/src/Warning/IPV6Deprecated.php index d752caa..59c3037 100644 --- a/src/Warning/IPV6Deprecated.php +++ b/src/Warning/IPV6Deprecated.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6Deprecated extends Warning { - const CODE = 13; + public const CODE = 13; public function __construct() { diff --git a/src/Warning/IPV6DoubleColon.php b/src/Warning/IPV6DoubleColon.php index 4f82394..d406602 100644 --- a/src/Warning/IPV6DoubleColon.php +++ b/src/Warning/IPV6DoubleColon.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6DoubleColon extends Warning { - const CODE = 73; + public const CODE = 73; public function __construct() { diff --git a/src/Warning/IPV6GroupCount.php b/src/Warning/IPV6GroupCount.php index a59d317..551bc3a 100644 --- a/src/Warning/IPV6GroupCount.php +++ b/src/Warning/IPV6GroupCount.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6GroupCount extends Warning { - const CODE = 72; + public const CODE = 72; public function __construct() { diff --git a/src/Warning/IPV6MaxGroups.php b/src/Warning/IPV6MaxGroups.php index 936274c..7f8a410 100644 --- a/src/Warning/IPV6MaxGroups.php +++ b/src/Warning/IPV6MaxGroups.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class IPV6MaxGroups extends Warning { - const CODE = 75; + public const CODE = 75; public function __construct() { diff --git a/src/Warning/LocalTooLong.php b/src/Warning/LocalTooLong.php index 0d08d8b..b46b874 100644 --- a/src/Warning/LocalTooLong.php +++ b/src/Warning/LocalTooLong.php @@ -4,8 +4,8 @@ namespace Egulias\EmailValidator\Warning; class LocalTooLong extends Warning { - const CODE = 64; - const LOCAL_PART_LENGTH = 64; + public const CODE = 64; + public const LOCAL_PART_LENGTH = 64; public function __construct() { diff --git a/src/Warning/NoDNSMXRecord.php b/src/Warning/NoDNSMXRecord.php index b3c21a1..bddb96b 100644 --- a/src/Warning/NoDNSMXRecord.php +++ b/src/Warning/NoDNSMXRecord.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class NoDNSMXRecord extends Warning { - const CODE = 6; + public const CODE = 6; public function __construct() { diff --git a/src/Warning/ObsoleteDTEXT.php b/src/Warning/ObsoleteDTEXT.php index 10f19e3..412fd49 100644 --- a/src/Warning/ObsoleteDTEXT.php +++ b/src/Warning/ObsoleteDTEXT.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class ObsoleteDTEXT extends Warning { - const CODE = 71; + public const CODE = 71; public function __construct() { diff --git a/src/Warning/QuotedPart.php b/src/Warning/QuotedPart.php index 36a4265..afa1f9e 100644 --- a/src/Warning/QuotedPart.php +++ b/src/Warning/QuotedPart.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class QuotedPart extends Warning { - const CODE = 36; + public const CODE = 36; /** * @param scalar $prevToken diff --git a/src/Warning/QuotedString.php b/src/Warning/QuotedString.php index 817e4e8..c152ec2 100644 --- a/src/Warning/QuotedString.php +++ b/src/Warning/QuotedString.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class QuotedString extends Warning { - const CODE = 11; + public const CODE = 11; /** * @param scalar $prevToken diff --git a/src/Warning/TLD.php b/src/Warning/TLD.php index 2338b9f..10cec28 100644 --- a/src/Warning/TLD.php +++ b/src/Warning/TLD.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; class TLD extends Warning { - const CODE = 9; + public const CODE = 9; public function __construct() { diff --git a/src/Warning/Warning.php b/src/Warning/Warning.php index a0158a2..8b39d64 100644 --- a/src/Warning/Warning.php +++ b/src/Warning/Warning.php @@ -4,7 +4,7 @@ namespace Egulias\EmailValidator\Warning; abstract class Warning { - const CODE = 0; + public const CODE = 0; /** * @var string