CodeExplorer translateDashMatch example
class AttributeMatchingExtension extends AbstractExtension
{ public function getAttributeMatchingTranslators(): array
{ return [ 'exists' =>
$this->
translateExists(...
),
'=' =>
$this->
translateEquals(...
),
'~=' =>
$this->
translateIncludes(...
),
'|=' =>
$this->
translateDashMatch(...
),
'^=' =>
$this->
translatePrefixMatch(...
),
'$=' =>
$this->
translateSuffixMatch(...
),
'*=' =>
$this->
translateSubstringMatch(...
),
'!=' =>
$this->
translateDifferent(...
),
];
} public function translateExists(XPathExpr
$xpath, string
$attribute, ?string
$value): XPathExpr
{ return $xpath->
addCondition($attribute);
}