Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
shouldCheckVatIdFormat example
throw
new
UnexpectedTypeException
(
$constraint
, CustomerVatIdentification::
class
)
;
}
if
(
$vatIds
=== null
)
{
return
;
}
if
(
!
is_iterable
(
$vatIds
)
)
{
throw
new
UnexpectedValueException
(
$vatIds
, 'iterable'
)
;
}
if
(
!
$this
->
shouldCheckVatIdFormat
(
$constraint
)
)
{
return
;
}
if
(
!
$vatPattern
=
$this
->
getVatPattern
(
$constraint
)
)
{
return
;
}
$regex
= '/^' .
$vatPattern
. '$/i';
foreach
(
$vatIds
as
$vatId
)
{
if
(
!
preg_match
(
$regex
,
(string)
$vatId
)
)
{