Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isNotBlank example
throw
new
DecorationPatternException
(
self::
class
)
;
}
/** * @param string[] $addresses * * @throws ConstraintViolationException */
private
function
assertValidAddresses
(
array
$addresses
)
: void
{
$constraints
=
(
new
ConstraintBuilder
(
)
)
->
isNotBlank
(
)
->
isEmail
(
)
->
getConstraints
(
)
;
$violations
=
new
ConstraintViolationList
(
)
;
foreach
(
$addresses
as
$address
)
{
$violations
->
addAll
(
$this
->validator->
validate
(
$address
,
$constraints
)
)
;
}
if
(
$violations
->
count
(
)
> 0
)
{
throw
new
ConstraintViolationException
(
$violations
,
$addresses
)
;
}
}