Skip to content
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

Merged
merged 6 commits into from
Apr 9, 2020

Conversation

VitaliyBoyko
Copy link
Contributor

Description (*)

Added project template for Magento 2 Module

Fixed Issues (if relevant)

  1. Project Template. Add project template for Magento Module #53: Project Template. Add project template for Magento Module

Startup

image

Code generation

image

Include path suggestion

image

Include path confirmation

image

Result

image

Also adjusted configs and fixed bugs with action scopes.

Copy link
Contributor

@eduard13 eduard13 left a 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;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line

Copy link
Contributor Author

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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid inline methods.

Suggested change
public boolean getCreateModuleDirs() { return this.createModuleDirs; }
public boolean getCreateModuleDirs() {
return this.createModuleDirs;
}

Copy link
Contributor Author

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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid inline methods.

Suggested change
public boolean getCreateModuleDirs() { return this.createModuleDirs; }
public boolean getCreateModuleDirs() {
return this.createModuleDirs;
}

Copy link
Contributor Author

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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid inline methods.

Suggested change
public boolean getCreateModuleDirs() { return this.createModuleDirs; }
public boolean getCreateModuleDirs() {
return this.createModuleDirs;
}

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(int i = 0; i < length; ++i) {
for (int i = 0; i < length; ++i) {

Copy link
Contributor Author

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) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line

Copy link
Contributor Author

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) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(int i = 0; i < length; ++i) {
for (int i = 0; i < length; ++i) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@eduard13 eduard13 left a 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.

@VitaliyBoyko VitaliyBoyko merged commit bf76b18 into 1.0.0-develop Apr 9, 2020
@VitaliyBoyko VitaliyBoyko deleted the 53-project-template branch April 9, 2020 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants