Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addName example
protected
function
parseSelectorPartAttribute
(
)
{
if
(
!
$this
->
consume
(
"["
)
)
{
return
null;
}
$this
->
consumeWhitespaces
(
)
;
$part
=
new
Node\Part\Attribute;
if
(
!
(
$name
=
$this
->
consumeWord
(
)
)
)
{
throw
new
Exception
(
"Missing attribute name"
)
;
}
$part
->
addName
(
$name
)
;
while
(
$this
->
consume
(
"."
)
)
{
if
(
!
(
$name
=
$this
->
consumeWord
(
)
)
)
{
throw
new
Exception
(
"Missing attribute name after dot"
)
;
}
$part
->
addName
(
$name
)
;
}
$this
->
consumeWhitespaces
(
)
;
$operator
=
$this
->
consumeAny
(
$this
->attrOperatorChars
)
;
if
(
$operator
)
{
if
(
!
in_array
(
$operator
,
$this
->attrOperators
)
)
{
throw
new
Exception
(
"Invalid attribute operator '
$operator
'"
)
;
}