-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Magento 2 module project template #130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @VitaliyBoyko, could you please review the below comments?
Thank you for the improvement.
import org.jetbrains.annotations.Nls; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
...om/magento/idea/magento2plugin/actions/generation/generator/ModuleComposerJsonGenerator.java
Outdated
Show resolved
Hide resolved
@@ -32,4 +35,6 @@ public String getModuleName() { | |||
public PsiDirectory getBaseDir() { | |||
return this.baseDir; | |||
} | |||
|
|||
public boolean getCreateModuleDirs() { return this.createModuleDirs; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid inline methods.
public boolean getCreateModuleDirs() { return this.createModuleDirs; } | |
public boolean getCreateModuleDirs() { | |
return this.createModuleDirs; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -32,4 +35,6 @@ public String getModuleName() { | |||
public PsiDirectory getBaseDir() { | |||
return this.baseDir; | |||
} | |||
|
|||
public boolean getCreateModuleDirs() { return this.createModuleDirs; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid inline methods.
public boolean getCreateModuleDirs() { return this.createModuleDirs; } | |
public boolean getCreateModuleDirs() { | |
return this.createModuleDirs; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -68,4 +71,7 @@ public String getModuleVersion() { | |||
public List<String> getModuleDependencies() { | |||
return moduleDependencies; | |||
} | |||
|
|||
public boolean getCreateModuleDirs() { return this.createModuleDirs; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid inline methods.
public boolean getCreateModuleDirs() { return this.createModuleDirs; } | |
public boolean getCreateModuleDirs() { | |
return this.createModuleDirs; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Function[] functions = actions; | ||
int length = actions.length; | ||
|
||
for(int i = 0; i < length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for(int i = 0; i < length; ++i) { | |
for (int i = 0; i < length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
|
||
@NotNull | ||
public PhpFrameworkConfigurable createConfigurable(@NotNull Project project) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
} | ||
|
||
public boolean isEnabled(@NotNull Project project) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
return VfsUtil.findRelativeFile(file, Package.APP, Package.MODULE_BASE_AREA_DIR, ModuleDiXml.FILE_NAME) != null && | ||
VfsUtil.findRelativeFile(file, new String[]{Package.VENDOR}) != null; | ||
} else { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that you may extract this return outside the else, and remove the else
ramification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
VirtualFile[] roots = contentRoots; | ||
int length = contentRoots.length; | ||
|
||
for(int i = 0; i < length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for(int i = 0; i < length; ++i) { | |
for (int i = 0; i < length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fixes.
Description (*)
Added project template for Magento 2 Module
Fixed Issues (if relevant)
Startup
Code generation
Include path suggestion
Include path confirmation
Result
Also adjusted configs and fixed bugs with action scopes.