File tree 3 files changed +7
-5
lines changed
src/com/magento/idea/magento2plugin
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,12 @@ public void update(final AnActionEvent event) {
91
91
.execute ((PsiDirectory ) psiElement , project );
92
92
if (moduleName == null ) {
93
93
final String sourceDirPath = ((PsiDirectory ) psiElement ).getVirtualFile ().getPath ();
94
+ final boolean isCustomCodeSourceDirValid =
95
+ MagentoBasePathUtil .isCustomCodeSourceDirValid (sourceDirPath );
96
+ final boolean isCustomVendorDirValid =
97
+ MagentoBasePathUtil .isCustomVendorDirValid (sourceDirPath );
94
98
95
- if (!MagentoBasePathUtil .isCustomCodeSourceDirValid (sourceDirPath )
96
- && !MagentoBasePathUtil .isCustomVendorDirValid (sourceDirPath )) {
99
+ if (!isCustomCodeSourceDirValid && !isCustomVendorDirValid ) {
97
100
event .getPresentation ().setVisible (false );
98
101
return ;
99
102
}
Original file line number Diff line number Diff line change 24
24
import com .magento .idea .magento2plugin .indexes .ModuleIndex ;
25
25
import com .magento .idea .magento2plugin .magento .files .ComposerJson ;
26
26
import com .magento .idea .magento2plugin .magento .packages .Licenses ;
27
- import com .magento .idea .magento2plugin .magento .packages .Package ;
28
27
import com .magento .idea .magento2plugin .project .Settings ;
29
28
import com .magento .idea .magento2plugin .util .CamelCaseToHyphen ;
30
29
import com .magento .idea .magento2plugin .util .magento .MagentoBasePathUtil ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public static boolean isMagentoFolderValid(final String path) {
51
51
public static boolean isCustomVendorDirValid (final @ NotNull String path ) {
52
52
final String [] pathParts = path .split (Package .V_FILE_SEPARATOR );
53
53
54
- if (pathParts .length < 3 ) {
54
+ if (pathParts .length < 3 ) { //NOPMD
55
55
return false ;
56
56
}
57
57
@@ -76,7 +76,7 @@ public static boolean isCustomVendorDirValid(final @NotNull String path) {
76
76
public static boolean isCustomCodeSourceDirValid (final @ NotNull String path ) {
77
77
final String [] pathParts = path .split (Package .V_FILE_SEPARATOR );
78
78
79
- if (pathParts .length < 2 ) {
79
+ if (pathParts .length < 2 ) { //NOPMD
80
80
return false ;
81
81
}
82
82
You can’t perform that action at this time.
0 commit comments