File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed
src/com/magento/idea/magento2plugin/actions/generation/generator/util
testData/actions/generation/generator/PluginClassGenerator/generatePluginClassFile
tests/com/magento/idea/magento2plugin/actions/generation/generator Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
-
4
3
namespace Foo \Bar \Plugin ;
5
4
6
-
7
5
use Foo \Bar \Service \SimpleService ;
8
6
9
7
class TestPlugin
Original file line number Diff line number Diff line change 9
9
import com .intellij .psi .PsiFile ;
10
10
import com .intellij .testFramework .LightPlatformTestCase ;
11
11
import com .magento .idea .magento2plugin .BaseProjectTestCase ;
12
+ import com .magento .idea .magento2plugin .actions .generation .generator .util .DefaultCodeStyleSettingsAdjustmentsUtil ;
12
13
import com .magento .idea .magento2plugin .magento .packages .File ;
13
14
import com .magento .idea .magento2plugin .project .util .GetProjectBasePath ;
14
15
import org .junit .After ;
@@ -25,6 +26,8 @@ public abstract class BaseGeneratorTestCase extends BaseProjectTestCase {
25
26
protected void setUp () throws Exception {
26
27
super .setUp ();
27
28
myFixture .setTestDataPath (TEST_DATA_FOLDER_PATH );
29
+ // Reset changed default code style settings to the previous default settings.
30
+ DefaultCodeStyleSettingsAdjustmentsUtil .execute (myFixture .getProject ());
28
31
}
29
32
30
33
@ Override
You can’t perform that action at this time.
0 commit comments