Skip to content

Code cleanup before release v4.0.0 #622

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).

## 4.0.0

### Added

- Added XML file header include code template in [#615](https://github.com/magento/magento2-phpstorm-plugin/pull/615)
- Added Web API generation for the Magento Entity Creator in [#597](https://github.com/magento/magento2-phpstorm-plugin/pull/597) and [#607](https://github.com/magento/magento2-phpstorm-plugin/pull/607)
- Added DI XML plugin type attribute inspections in [#588](https://github.com/magento/magento2-phpstorm-plugin/pull/588)
- Added Web API interface for service (PHP class) generation in [#586](https://github.com/magento/magento2-phpstorm-plugin/pull/586)
- Added DI XML type tag attributes inspections that related to the PHP/Magento types in [#582](https://github.com/magento/magento2-phpstorm-plugin/pull/582)
- Added DI XML preference tag attributes inspections in [#578](https://github.com/magento/magento2-phpstorm-plugin/pull/578)
- Added Web API XML service tag attributes inspections in [#577](https://github.com/magento/magento2-phpstorm-plugin/pull/577)
- Added an error handler to help user with a new bug issue creation on the GitHub side in [#552](https://github.com/magento/magento2-phpstorm-plugin/pull/552) and [#593](https://github.com/magento/magento2-phpstorm-plugin/pull/593)
- Added Web API declaration generation in [#548](https://github.com/magento/magento2-phpstorm-plugin/pull/548) and [#595](https://github.com/magento/magento2-phpstorm-plugin/pull/595)
- Added JS and CSS support for Copy Magento Path action in [#536](https://github.com/magento/magento2-phpstorm-plugin/pull/536)

### Changed

- Changed the content of the generated plugin class in [#612](https://github.com/magento/magento2-phpstorm-plugin/pull/612)
- Changed using of hardcoded entity id value into the constant in all files generated by the Entity Creator in [#606](https://github.com/magento/magento2-phpstorm-plugin/pull/606)

### Fixed

- Fixed a casting exception in the XML index in [#617](https://github.com/magento/magento2-phpstorm-plugin/pull/617)
- Fixed a bug with plugin generation for complex non-primitive types in [#609](https://github.com/magento/magento2-phpstorm-plugin/pull/609)
- Fixed a bug with the namespace generation in a generated controller in [#571](https://github.com/magento/magento2-phpstorm-plugin/pull/571)
- Fixed a bug with directory validation for the generation dialogues in [#565](https://github.com/magento/magento2-phpstorm-plugin/pull/565)
- Fixed wrong entity data mapper file template position in [#549](https://github.com/magento/magento2-phpstorm-plugin/pull/549)
- Fixed incorrect data saving into table model within editing a table in [#544](https://github.com/magento/magento2-phpstorm-plugin/pull/544)
- Fixed an error when plugin or observer name is not set in [#533](https://github.com/magento/magento2-phpstorm-plugin/pull/533)
- Fixed incorrect duplication warning for disabled plugin in di.xml in [#529](https://github.com/magento/magento2-phpstorm-plugin/pull/529)

## 3.2.2

### Fixed
Expand Down
28 changes: 14 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/

plugins {
id 'org.jetbrains.intellij' version '0.7.2'
id 'org.jetbrains.intellij' version '1.1.4'
id 'checkstyle'
id 'pmd'
id 'org.jetbrains.changelog' version '0.6.2'
id 'org.jetbrains.changelog' version '1.2.1'
}

repositories {
Expand All @@ -23,35 +23,35 @@ apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'org.jetbrains.changelog'

def phpPluginVersion = System.getProperty("phpPluginVersion", "211.6693.111")
def ideaVersion = System.getProperty("ideaVersion", "2021.1")
def phpPluginVersion = System.getProperty("phpPluginVersion", "212.5080.71")
def ideaVersion = System.getProperty("ideaVersion", "2021.2.1")
def javaVersion = 11

sourceCompatibility = javaVersion
targetCompatibility = javaVersion

intellij {
version ideaVersion
type 'IU'
pluginName 'com.magento.idea.magento2plugin'
version = ideaVersion
type = 'IU'
pluginName = 'com.magento.idea.magento2plugin'
plugins = [
"com.jetbrains.php:$phpPluginVersion",
'yaml',
'java-i18n',
'properties',
'CSS',
'JavaScriptLanguage',
'com.intellij.lang.jsgraphql:2.9.1',
'com.intellij.lang.jsgraphql:3.0.0',
'platform-images',
'copyright'
]
updateSinceUntilBuild false
sameSinceUntilBuild false
downloadSources !Boolean.valueOf(System.getenv('CI'))
sandboxDirectory "${project.rootDir}/.idea-sandbox"
updateSinceUntilBuild = false
sameSinceUntilBuild = false
downloadSources = !Boolean.valueOf(System.getenv('CI'))
sandboxDir = "${project.rootDir}/.idea-sandbox"

patchPluginXml {
changeNotes({ changelog.getLatest().toHTML() })
changeNotes = provider { changelog.getLatest().toHTML() }
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ apply from: "${project.rootDir}/gradle-tasks/staticChecks.gradle"
changelog {
version = "${project.version}"
path = "${project.projectDir}/CHANGELOG.md"
header = { "[${project.version}] - ${getDate()}" }
header = provider { "[${project.version}] - ${getDate()}" }
headerParserRegex = ~/(\d+\.)?(\d+\.)?(\*|\d+)/
itemPrefix = "-"
keepUnreleasedSection = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.actions.generation.generator.util;

import com.intellij.openapi.project.Project;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import org.jetbrains.annotations.NotNull;

public final class DefaultCodeStyleSettingsAdjustmentsUtil {

private DefaultCodeStyleSettingsAdjustmentsUtil() {
}

/**
* Adjust default code style settings for project.
*
* @param project Project
*/
public static void execute(final @NotNull Project project) {
final CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager
.getInstance(project)
.getTemporarySettings();

if (codeStyleSettings == null) {
return;
}
final CommonCodeStyleSettings commonPhpSettings = codeStyleSettings
.getCommonSettings("PHP");
// This value has changed to TRUE by default in the latest releases.
// This is necessary to return the value by default to the previous one.
commonPhpSettings.ALIGN_MULTILINE_PARAMETERS = false;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace Foo\Bar\Plugin;


use Foo\Bar\Service\SimpleService;

class TestPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.LightPlatformTestCase;
import com.magento.idea.magento2plugin.BaseProjectTestCase;
import com.magento.idea.magento2plugin.actions.generation.generator.util.DefaultCodeStyleSettingsAdjustmentsUtil;
import com.magento.idea.magento2plugin.magento.packages.File;
import com.magento.idea.magento2plugin.project.util.GetProjectBasePath;
import org.junit.After;
Expand All @@ -25,6 +26,8 @@ public abstract class BaseGeneratorTestCase extends BaseProjectTestCase {
protected void setUp() throws Exception {
super.setUp();
myFixture.setTestDataPath(TEST_DATA_FOLDER_PATH);
// Reset changed default code style settings to the previous default settings.
DefaultCodeStyleSettingsAdjustmentsUtil.execute(myFixture.getProject());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package com.magento.idea.magento2plugin.linemarker.php;

import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.linemarker.LinemarkerFixtureTestCase;

Expand All @@ -32,8 +32,8 @@ public void testWebApiServiceShouldHaveLinemarker() {
// work around for issue caused by
// com.magento.idea.magento2plugin.linemarker.xml.LineMarkerXmlTagDecorator
// in com.intellij.psi.impl.smartPointers.SmartPsiElementPointerImpl.createElementInfo
final boolean isInStressTestCurrent = ApplicationInfoImpl.isInStressTest();
ApplicationInfoImpl.setInStressTest(true);
final boolean isInStressTestCurrent = ApplicationManagerEx.isInStressTest();
ApplicationManagerEx.setInStressTest(true);

myFixture.configureByFile(this.getFixturePath("TestService.php", "php"));

Expand All @@ -54,7 +54,7 @@ public void testWebApiServiceShouldHaveLinemarker() {
);

//restore default value
ApplicationInfoImpl.setInStressTest(isInStressTestCurrent);
ApplicationManagerEx.setInStressTest(isInStressTestCurrent);
}

/**
Expand Down