Skip to content

Commit 16029d6

Browse files
author
Vitaliy
authored
Merge pull request #622 from bohdan-harniuk/code-cleanup-before-4-0-0-version-release
Code cleanup before release v4.0.0
2 parents 72eeb4e + 0b6b976 commit 16029d6

File tree

6 files changed

+88
-20
lines changed

6 files changed

+88
-20
lines changed

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

77
## 4.0.0
88

9+
### Added
10+
11+
- Added XML file header include code template in [#615](https://github.com/magento/magento2-phpstorm-plugin/pull/615)
12+
- 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)
13+
- Added DI XML plugin type attribute inspections in [#588](https://github.com/magento/magento2-phpstorm-plugin/pull/588)
14+
- Added Web API interface for service (PHP class) generation in [#586](https://github.com/magento/magento2-phpstorm-plugin/pull/586)
15+
- 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)
16+
- Added DI XML preference tag attributes inspections in [#578](https://github.com/magento/magento2-phpstorm-plugin/pull/578)
17+
- Added Web API XML service tag attributes inspections in [#577](https://github.com/magento/magento2-phpstorm-plugin/pull/577)
18+
- 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)
19+
- 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)
20+
- Added JS and CSS support for Copy Magento Path action in [#536](https://github.com/magento/magento2-phpstorm-plugin/pull/536)
21+
22+
### Changed
23+
24+
- Changed the content of the generated plugin class in [#612](https://github.com/magento/magento2-phpstorm-plugin/pull/612)
25+
- 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)
26+
27+
### Fixed
28+
29+
- Fixed a casting exception in the XML index in [#617](https://github.com/magento/magento2-phpstorm-plugin/pull/617)
30+
- Fixed a bug with plugin generation for complex non-primitive types in [#609](https://github.com/magento/magento2-phpstorm-plugin/pull/609)
31+
- Fixed a bug with the namespace generation in a generated controller in [#571](https://github.com/magento/magento2-phpstorm-plugin/pull/571)
32+
- Fixed a bug with directory validation for the generation dialogues in [#565](https://github.com/magento/magento2-phpstorm-plugin/pull/565)
33+
- Fixed wrong entity data mapper file template position in [#549](https://github.com/magento/magento2-phpstorm-plugin/pull/549)
34+
- Fixed incorrect data saving into table model within editing a table in [#544](https://github.com/magento/magento2-phpstorm-plugin/pull/544)
35+
- Fixed an error when plugin or observer name is not set in [#533](https://github.com/magento/magento2-phpstorm-plugin/pull/533)
36+
- Fixed incorrect duplication warning for disabled plugin in di.xml in [#529](https://github.com/magento/magento2-phpstorm-plugin/pull/529)
37+
938
## 3.2.2
1039

1140
### Fixed

build.gradle

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*/
55

66
plugins {
7-
id 'org.jetbrains.intellij' version '0.7.2'
7+
id 'org.jetbrains.intellij' version '1.1.4'
88
id 'checkstyle'
99
id 'pmd'
10-
id 'org.jetbrains.changelog' version '0.6.2'
10+
id 'org.jetbrains.changelog' version '1.2.1'
1111
}
1212

1313
repositories {
@@ -23,35 +23,35 @@ apply plugin: 'idea'
2323
apply plugin: 'groovy'
2424
apply plugin: 'org.jetbrains.changelog'
2525

26-
def phpPluginVersion = System.getProperty("phpPluginVersion", "211.6693.111")
27-
def ideaVersion = System.getProperty("ideaVersion", "2021.1")
26+
def phpPluginVersion = System.getProperty("phpPluginVersion", "212.5080.71")
27+
def ideaVersion = System.getProperty("ideaVersion", "2021.2.1")
2828
def javaVersion = 11
2929

3030
sourceCompatibility = javaVersion
3131
targetCompatibility = javaVersion
3232

3333
intellij {
34-
version ideaVersion
35-
type 'IU'
36-
pluginName 'com.magento.idea.magento2plugin'
34+
version = ideaVersion
35+
type = 'IU'
36+
pluginName = 'com.magento.idea.magento2plugin'
3737
plugins = [
3838
"com.jetbrains.php:$phpPluginVersion",
3939
'yaml',
4040
'java-i18n',
4141
'properties',
4242
'CSS',
4343
'JavaScriptLanguage',
44-
'com.intellij.lang.jsgraphql:2.9.1',
44+
'com.intellij.lang.jsgraphql:3.0.0',
4545
'platform-images',
4646
'copyright'
4747
]
48-
updateSinceUntilBuild false
49-
sameSinceUntilBuild false
50-
downloadSources !Boolean.valueOf(System.getenv('CI'))
51-
sandboxDirectory "${project.rootDir}/.idea-sandbox"
48+
updateSinceUntilBuild = false
49+
sameSinceUntilBuild = false
50+
downloadSources = !Boolean.valueOf(System.getenv('CI'))
51+
sandboxDir = "${project.rootDir}/.idea-sandbox"
5252

5353
patchPluginXml {
54-
changeNotes({ changelog.getLatest().toHTML() })
54+
changeNotes = provider { changelog.getLatest().toHTML() }
5555
}
5656
}
5757

@@ -85,7 +85,7 @@ apply from: "${project.rootDir}/gradle-tasks/staticChecks.gradle"
8585
changelog {
8686
version = "${project.version}"
8787
path = "${project.projectDir}/CHANGELOG.md"
88-
header = { "[${project.version}] - ${getDate()}" }
88+
header = provider { "[${project.version}] - ${getDate()}" }
8989
headerParserRegex = ~/(\d+\.)?(\d+\.)?(\*|\d+)/
9090
itemPrefix = "-"
9191
keepUnreleasedSection = true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.actions.generation.generator.util;
7+
8+
import com.intellij.openapi.project.Project;
9+
import com.intellij.psi.codeStyle.CodeStyleSettings;
10+
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
11+
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
12+
import org.jetbrains.annotations.NotNull;
13+
14+
public final class DefaultCodeStyleSettingsAdjustmentsUtil {
15+
16+
private DefaultCodeStyleSettingsAdjustmentsUtil() {
17+
}
18+
19+
/**
20+
* Adjust default code style settings for project.
21+
*
22+
* @param project Project
23+
*/
24+
public static void execute(final @NotNull Project project) {
25+
final CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager
26+
.getInstance(project)
27+
.getTemporarySettings();
28+
29+
if (codeStyleSettings == null) {
30+
return;
31+
}
32+
final CommonCodeStyleSettings commonPhpSettings = codeStyleSettings
33+
.getCommonSettings("PHP");
34+
// This value has changed to TRUE by default in the latest releases.
35+
// This is necessary to return the value by default to the previous one.
36+
commonPhpSettings.ALIGN_MULTILINE_PARAMETERS = false;
37+
}
38+
}

testData/actions/generation/generator/PluginClassGenerator/generatePluginClassFile/TestPlugin.php

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22

3-
43
namespace Foo\Bar\Plugin;
54

6-
75
use Foo\Bar\Service\SimpleService;
86

97
class TestPlugin

tests/com/magento/idea/magento2plugin/actions/generation/generator/BaseGeneratorTestCase.java

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.intellij.psi.PsiFile;
1010
import com.intellij.testFramework.LightPlatformTestCase;
1111
import com.magento.idea.magento2plugin.BaseProjectTestCase;
12+
import com.magento.idea.magento2plugin.actions.generation.generator.util.DefaultCodeStyleSettingsAdjustmentsUtil;
1213
import com.magento.idea.magento2plugin.magento.packages.File;
1314
import com.magento.idea.magento2plugin.project.util.GetProjectBasePath;
1415
import org.junit.After;
@@ -25,6 +26,8 @@ public abstract class BaseGeneratorTestCase extends BaseProjectTestCase {
2526
protected void setUp() throws Exception {
2627
super.setUp();
2728
myFixture.setTestDataPath(TEST_DATA_FOLDER_PATH);
29+
// Reset changed default code style settings to the previous default settings.
30+
DefaultCodeStyleSettingsAdjustmentsUtil.execute(myFixture.getProject());
2831
}
2932

3033
@Override

tests/com/magento/idea/magento2plugin/linemarker/php/WebApiLinemarkerRegistrarTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

8-
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
8+
import com.intellij.openapi.application.ex.ApplicationManagerEx;
99
import com.magento.idea.magento2plugin.MagentoIcons;
1010
import com.magento.idea.magento2plugin.linemarker.LinemarkerFixtureTestCase;
1111

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

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

@@ -54,7 +54,7 @@ public void testWebApiServiceShouldHaveLinemarker() {
5454
);
5555

5656
//restore default value
57-
ApplicationInfoImpl.setInStressTest(isInStressTestCurrent);
57+
ApplicationManagerEx.setInStressTest(isInStressTestCurrent);
5858
}
5959

6060
/**

0 commit comments

Comments
 (0)