return new PsiReference[0];
}
// get the service name "service_container"
String text = psiElement.getText();
return new PsiReference[]{ new PhpClassReference(psiElement, text) };
}
}
);
// <argument>%form.resolved_type_factory.class%</argument>
registrar.registerReferenceProvider(
XmlHelper.getArgumentValuePattern(),
new PsiReferenceProvider() {
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement psiElement, @NotNull ProcessingContext processingContext) {
if(!Symfony2ProjectComponent.isEnabled(psiElement)) {
return new PsiReference[0];
}
PsiElement parent = psiElement.getParent();
if(!(parent instanceof XmlText)) {
return new PsiReference[0];
}
return new PsiReference[]{ new ParameterXmlReference(((XmlText) parent)) };
}
}
);
// <tag name="kernel.event_subscriber" />
registrar.registerReferenceProvider(
XmlHelper.getTagAttributePattern("tag", "name")
.inside(XmlHelper.getInsideTagPattern("services"))
.inFile(XmlHelper.getXmlFilePattern()),
new PsiReferenceProvider() {
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
if(!Symfony2ProjectComponent.isEnabled(element)) {
return new PsiReference[0];
}
if(element instanceof XmlAttributeValue) {
return new PsiReference[] { new TagReference(element, PsiElementUtils.trimQuote(element.getText()))};
}
return new PsiReference[0];
}
}
);
// <tag event="foo" method="kernel.event_subscriber" />
registrar.registerReferenceProvider(
XmlHelper.getTagAttributePattern("tag", "method")
.inside(XmlHelper.getInsideTagPattern("services"))
.inFile(XmlHelper.getXmlFilePattern()),
new ClassMethodReferenceProvider()
);
registrar.registerReferenceProvider(
XmlHelper.getTagAttributePattern("call", "method")
.inside(XmlHelper.getInsideTagPattern("services"))
.inFile(XmlHelper.getXmlFilePattern()),
new ClassMethodReferenceProvider()
);
registrar.registerReferenceProvider(
XmlHelper.getParameterWithClassEndingPattern()
.inside(XmlHelper.getInsideTagPattern("parameters"))
.inFile(XmlHelper.getXmlFilePattern()
),
new PsiReferenceProvider() {
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
if(!Symfony2ProjectComponent.isEnabled(element)) {
return new PsiReference[0];
}
if(element instanceof XmlToken) {
return new PsiReference[] {
new PhpClassReference(element, PsiElementUtils.removeIdeaRuleHack(PsiElementUtils.trimQuote(element.getText())), true)
};
}
return new PsiReference[0];
}