// get over the attribute and look for php attributes
NamedNodeMap attributes = node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
AttrImplForTwig attribute = (AttrImplForTwig) attributes.item(i);
ITextRegionContainer container = null;
if (attribute.getNameRegion() instanceof ITextRegionContainer) {
container = (ITextRegionContainer) attribute.getNameRegion();
}
if (attribute.getValueRegion() instanceof ITextRegionContainer) {
container = (ITextRegionContainer) attribute.getValueRegion();
}
if (container != null
&& (container.getFirstRegion().getType()
.equals(TwigRegionContext.TWIG_OPEN) || container
.getFirstRegion().getType()
.equals(TwigRegionContext.TWIG_STMT_OPEN))) {
TwigFormatter phpFormatter = new TwigFormatter(
attribute.getStartOffset(), attribute.getEndOffset());
phpFormatter.format(attribute, contraints);
}
}
}