Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
checkEndOfDomain example
if
(
$this
->lexer->current->
isA
(
EmailLexer::S_AT
)
)
{
return
new
InvalidEmail
(
new
ConsecutiveAt
(
)
,
$this
->lexer->current->value
)
;
}
$result
=
$this
->
doParseDomainPart
(
)
;
if
(
$result
->
isInvalid
(
)
)
{
return
$result
;
}
$end
=
$this
->
checkEndOfDomain
(
)
;
if
(
$end
->
isInvalid
(
)
)
{
return
$end
;
}
$this
->lexer->
stopRecording
(
)
;
$this
->domainPart =
$this
->lexer->
getAccumulatedValues
(
)
;
$length
=
strlen
(
$this
->domainPart
)
;
if
(
$length
> self::DOMAIN_MAX_LENGTH
)
{
return
new
InvalidEmail
(
new
DomainTooLong
(
)
,
$this
->lexer->current->value
)
;
}