22 * Copyright © Magento, Inc. All rights reserved.
33 * See COPYING.txt for license details.
44 */
5+
56package com .magento .idea .magento2plugin .reference .provider ;
67
78import com .intellij .openapi .util .text .StringUtil ;
1516import com .intellij .util .indexing .FileBasedIndex ;
1617import com .jetbrains .php .lang .PhpFileType ;
1718import com .jetbrains .php .lang .psi .PhpFile ;
18- import com .magento .idea .magento2plugin .util .php .PhpPatternsHelper ;
1919import com .magento .idea .magento2plugin .reference .xml .PolyVariantReferenceBase ;
2020import com .magento .idea .magento2plugin .stubs .indexes .EventNameIndex ;
21- import org .jetbrains .annotations .NotNull ;
22-
21+ import com .magento .idea .magento2plugin .util .php .PhpPatternsHelper ;
2322import java .util .ArrayList ;
2423import java .util .Collection ;
2524import java .util .List ;
25+ import org .jetbrains .annotations .NotNull ;
2626
2727public class EventNameReferenceProvider extends PsiReferenceProvider {
2828
@@ -35,12 +35,14 @@ public PsiReference[] getReferencesByElement(
3535 final String value = StringUtil .unquoteString (element .getText ());
3636 final List <PsiReference > psiReferences = new ArrayList <>();
3737 final Collection <VirtualFile > containingFiles = FileBasedIndex .getInstance ()
38- .getContainingFiles (EventNameIndex .KEY , value ,
39- GlobalSearchScope .getScopeRestrictedByFileTypes (
40- GlobalSearchScope .allScope (element .getProject ()),
41- PhpFileType .INSTANCE
42- )
43- );
38+ .getContainingFiles (
39+ EventNameIndex .KEY ,
40+ value ,
41+ GlobalSearchScope .getScopeRestrictedByFileTypes (
42+ GlobalSearchScope .allScope (element .getProject ()),
43+ PhpFileType .INSTANCE
44+ )
45+ );
4446
4547 final PsiManager psiManager = PsiManager .getInstance (element .getProject ());
4648 final List <PsiElement > psiElements = new ArrayList <>();
@@ -49,7 +51,7 @@ public PsiReference[] getReferencesByElement(
4951 if (phpFile != null ) {
5052 recursiveFill (psiElements , phpFile , value );
5153 if (!psiElements .isEmpty ()) {
52- psiReferences .add (new PolyVariantReferenceBase (element , psiElements ));
54+ psiReferences .add (new PolyVariantReferenceBase (element , psiElements ));//NOPMD
5355 break ;
5456 }
5557 }
0 commit comments