protected static function convertProperty($name, $args = [])
{
if ($name === 'text') {
return 'text()';
}
if ($name === 'attr') {
$attributes = [];
foreach ($args as $attribute) {
$attributes[] = sprintf('name() = "%s"', $attribute);
}
return sprintf('@*[%s]', implode(' or ', $attributes));
}
throw new RuntimeException('Invalid selector: unknown property type');
}