Skip to content

Commit 1742009

Browse files
committed
Merge remote-tracking branch 'origin/5.0.0-develop' into config-directory-inspection
2 parents e820c40 + c8f351a commit 1742009

File tree

40 files changed

+2084
-106
lines changed

40 files changed

+2084
-106
lines changed

Diff for: CHANGELOG.md

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

99
## 4.4.0
1010

11+
### Added
12+
13+
- Code generation of a Data Patch file with a Customer EAV attribute [#583](https://github.com/magento/magento2-phpstorm-plugin/pull/583)
14+
- Code generation of a Data Patch file with a Product EAV attribute [#527](https://github.com/magento/magento2-phpstorm-plugin/pull/527)
15+
- Code generation of a Data Patch file with a Category EAV attribute [#569](https://github.com/magento/magento2-phpstorm-plugin/pull/569)
16+
- Code generation of Readme file [#1133](https://github.com/magento/magento2-phpstorm-plugin/pull/1133)
17+
- Code generation of GraphQl schema file [#1123](https://github.com/magento/magento2-phpstorm-plugin/pull/1123)
18+
- Optional generation of Readme file during the creation of a new module [#1110](https://github.com/magento/magento2-phpstorm-plugin/pull/1110)
19+
- Code completion for `system.xml` and `config.xml` [#1077](https://github.com/magento/magento2-phpstorm-plugin/pull/1077)
20+
- Added easier navigation through plugins [#1121](https://github.com/magento/magento2-phpstorm-plugin/pull/1121)
21+
- Added inspection to check if type attr value in the virtual type tag attribute value exists [#1176](https://github.com/magento/magento2-phpstorm-plugin/pull/1176)
22+
- Added checks and detailed error messages during plugin activation [#1181](https://github.com/magento/magento2-phpstorm-plugin/pull/1181)
23+
24+
### Fixed
25+
26+
- Fixed NullPointerException at ObserverDeclarationInspection.java:188 [#1143](https://github.com/magento/magento2-phpstorm-plugin/issues/1143)
27+
- Fixed IncorrectOperationException: Rebind cannot be performed for class PolyVariantReferenceBase [#1173](https://github.com/magento/magento2-phpstorm-plugin/pull/1173)
28+
- Fixed create an observer for an event doesn't work through the context menu [#1166](https://github.com/magento/magento2-phpstorm-plugin/pull/1166)
29+
- Fixed IOException: Invalid file name at ReportBuilder [#1154](https://github.com/magento/magento2-phpstorm-plugin/pull/1154)
30+
- Fixed IllegalArgumentException in NewModuleAction class [#1150](https://github.com/magento/magento2-phpstorm-plugin/pull/1150)
31+
- Fixed null data in ModuleIndex class [#1132](https://github.com/magento/magento2-phpstorm-plugin/pull/1132)
32+
- Fixed StringIndexOutOfBoundsException: GitHubNewIssueBodyBuilderUtil [#1130](https://github.com/magento/magento2-phpstorm-plugin/pull/1130)
33+
- Fixed ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 0 in OverrideClassByAPreferenceDialog [#1129](https://github.com/magento/magento2-phpstorm-plugin/pull/1129)
34+
- Fixed PatternSyntaxException: MagentoBasePathUtil.isMagentoFolderValid:35 for Windows styled dir path separator [#1126](https://github.com/magento/magento2-phpstorm-plugin/pull/1126)
35+
- Fixed NullPointerException in the OverrideTemplateInThemeAction.isOverrideAllowed for virtualFile.getCanonicalPath() [#1125](https://github.com/magento/magento2-phpstorm-plugin/pull/1125)
36+
- Fixed IllegalArgumentException: Argument for @NotNull parameter 'dataKey' must not be null in CompareTemplateAction [#1117](https://github.com/magento/magento2-phpstorm-plugin/pull/1117)
37+
- Fixed argument for @NotNull parameter 'project' must not be null in the OverrideClassByAPreferenceAction [#1116](https://github.com/magento/magento2-phpstorm-plugin/pull/1116)
38+
- Fixed New layout action doesn't accept valid layout names [#1114](https://github.com/magento/magento2-phpstorm-plugin/pull/1114)
39+
40+
## 4.3.1
41+
42+
### Changed
43+
44+
- Added raw plugin verifier configuration in [#1065](https://github.com/magento/magento2-phpstorm-plugin/pull/1065)
45+
46+
### Fixed
47+
48+
- Fixed bug with the file separator on Windows OS (while saving plugin settings) in [#1062](https://github.com/magento/magento2-phpstorm-plugin/pull/1062)
49+
- Fixed bug with wrong text range for FilePathReferenceProvider.getReferencesByElement in [#1063](https://github.com/magento/magento2-phpstorm-plugin/pull/1063)
50+
- Fixed module files action group is accessible from the theme context in [#1064](https://github.com/magento/magento2-phpstorm-plugin/pull/1064)
51+
- Fixed bug with directory index is already disposed for Project in AllFilesExceptTestsScope.contains in [#1080](https://github.com/magento/magento2-phpstorm-plugin/pull/1080)
52+
- Fixed bug with DumbService cannot be created because container is already disposed in MagentoComponentManager.getComponents in [#1081](https://github.com/magento/magento2-phpstorm-plugin/pull/1081)
53+
1154
## 4.3.0
1255

1356
### Added

Diff for: build.gradle

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

66
plugins {
7-
id 'org.jetbrains.intellij' version '1.5.2'
7+
id 'org.jetbrains.intellij' version '1.1.4'
88
id 'checkstyle'
99
id 'pmd'
1010
id 'org.jetbrains.changelog' version '1.2.1'
@@ -23,8 +23,8 @@ apply plugin: 'idea'
2323
apply plugin: 'groovy'
2424
apply plugin: 'org.jetbrains.changelog'
2525

26-
def phpPluginVersion = System.getProperty("phpPluginVersion", "222.3739.45")
27-
def ideaVersion = System.getProperty("ideaVersion", "2022.2.1")
26+
def phpPluginVersion = System.getProperty("phpPluginVersion", "212.5080.55")
27+
def ideaVersion = System.getProperty("ideaVersion", "2021.2.1")
2828
def javaVersion = 11
2929

3030
sourceCompatibility = javaVersion
@@ -41,7 +41,7 @@ intellij {
4141
'properties',
4242
'CSS',
4343
'JavaScriptLanguage',
44-
'com.intellij.lang.jsgraphql:3.2.1',
44+
'com.intellij.lang.jsgraphql:3.1.2',
4545
'platform-images',
4646
'copyright'
4747
]

Diff for: resources/META-INF/plugin.xml

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</change-notes>
2525

2626
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
27-
<idea-version since-build="222.3739.54"/>
27+
<idea-version since-build="212.5080.55"/>
2828

2929
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
3030
on how to target different products -->
@@ -60,11 +60,11 @@
6060
<separator/>
6161
<!-- Context dependent actions -->
6262
<action id="MagentoCreateAclFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewAclXmlAction"/>
63-
<action id="MagentoCreateGraphQlSchemaFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewGraphQLSchemaAction"/>
6463
<action id="MagentoCreateConfigFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewConfigXmlAction"/>
6564
<action id="MagentoCreateCrontabFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewCrontabXmlAction"/>
6665
<action id="MagentoCreateDiFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewDiXmlAction"/>
6766
<action id="MagentoCreateEmailTemplatesFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewEmailTemplatesXmlAction"/>
67+
<action id="MagentoCreateEventsFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewEventsXmlAction"/>
6868
<action id="MagentoCreateExtensionAttributesFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewExtensionAttributesXmlAction"/>
6969
<action id="MagentoCreateFieldsetFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewFieldsetXmlAction"/>
7070
<action id="MagentoCreateIndexerFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewIndexerXmlAction"/>
@@ -78,6 +78,8 @@
7878
<action id="MagentoCreateWidgetFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewWidgetXmlAction"/>
7979
<action id="MagentoCreateLayoutFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewLayoutXmlAction"/>
8080
<action id="MagentoCreateReadmeFile" class="com.magento.idea.magento2plugin.actions.context.md.NewReadmeMdAction"/>
81+
<action id="MagentoNewObserverFile" class="com.magento.idea.magento2plugin.actions.context.php.NewObserverAction"/>
82+
<action id="MagentoNewSetupDataPatchFile" class="com.magento.idea.magento2plugin.actions.context.php.NewSetupDataPatchAction"/>
8183
<!-- Context dependent actions -->
8284
<separator/>
8385
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewXml"/>
@@ -91,7 +93,6 @@
9193
<action id="MagentoCreateACronjob" class="com.magento.idea.magento2plugin.actions.generation.NewCronjobAction" />
9294
<action id="MagentoCreateACronGroup" class="com.magento.idea.magento2plugin.actions.generation.NewCronGroupAction" />
9395
<action id="MagentoCreateAViewModel" class="com.magento.idea.magento2plugin.actions.generation.NewViewModelAction" />
94-
<action id="MagentoCreateAGraphQlResolver" class="com.magento.idea.magento2plugin.actions.generation.NewGraphQlResolverAction" />
9596
<action id="MagentoCreateCLICommand" class="com.magento.idea.magento2plugin.actions.generation.NewCLICommandAction" />
9697
<action id="MagentoCreateEmailTemplate" class="com.magento.idea.magento2plugin.actions.generation.NewEmailTemplateAction" />
9798
<action id="MagentoCreateUiComponentGrid" class="com.magento.idea.magento2plugin.actions.generation.NewUiComponentGridAction" />
@@ -628,7 +629,6 @@
628629
<internalFileTemplate name="Magento Regular Class"/>
629630
<internalFileTemplate name="Magento Observer Class"/>
630631
<internalFileTemplate name="Magento Events XML"/>
631-
<internalFileTemplate name="Magento GraphQL Resolver Class"/>
632632
<internalFileTemplate name="Magento Cron Job Class"/>
633633
<internalFileTemplate name="Magento Cron Tab XML"/>
634634
<internalFileTemplate name="Magento CLI Command Class"/>
@@ -642,7 +642,6 @@
642642
<internalFileTemplate name="Magento Routes XML"/>
643643
<internalFileTemplate name="Magento Layout XML"/>
644644
<internalFileTemplate name="Magento ACL XML"/>
645-
<internalFileTemplate name="Magento GraphQL Schema"/>
646645
<internalFileTemplate name="Magento Collection Class"/>
647646
<internalFileTemplate name="Magento Model Class"/>
648647
<internalFileTemplate name="Magento Resource Model Class"/>

Diff for: resources/META-INF/withJsGraphQl.xml

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
-->
77

88
<idea-plugin>
9+
<actions>
10+
<group id="GraphQL.MagentoContextBasedActionsGroup">
11+
<add-to-group group-id="MagentoContextBasedActionsGroup" anchor="last"/>
12+
<action id="MagentoCreateGraphQlSchemaFile"
13+
class="com.magento.idea.magento2plugin.actions.context.xml.NewGraphQLSchemaAction"/>
14+
</group>
15+
<group id="GraphQL.MagentoNewModuleFileGroup"
16+
text="GraphQL"
17+
popup="false">
18+
<add-to-group group-id="MagentoNewModuleFileGroup" anchor="last"/>
19+
<action id="MagentoCreateAGraphQlResolver" class="com.magento.idea.magento2plugin.actions.generation.NewGraphQlResolverAction" />
20+
</group>
21+
</actions>
922
<extensions defaultExtensionNs="com.intellij">
1023
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.graphql.GraphQlResolverIndex" />
1124
<codeInsight.lineMarkerProvider language="PHP" implementationClass="com.magento.idea.magento2plugin.linemarker.php.GraphQlResolverUsageLineMarkerProvider"/>
@@ -22,5 +35,8 @@
2235
enabledByDefault="true"
2336
level="ERROR"
2437
implementationClass="com.magento.idea.magento2plugin.inspections.graphqls.SchemaResolverInspection"/>
38+
39+
<internalFileTemplate name="Magento GraphQL Resolver Class"/>
40+
<internalFileTemplate name="Magento GraphQL Schema"/>
2541
</extensions>
2642
</idea-plugin>

Diff for: resources/fileTemplates/internal/Magento Customer Eav Attribute Data Patch Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ${CLASS_NAME} implements ${IMPLEMENTS}
7777
$eavSetup->addAttributeToSet(
7878
${CUSTOMER_METADATA_INTERFACE}::ENTITY_TYPE_CUSTOMER,
7979
${CUSTOMER_METADATA_INTERFACE}::ATTRIBUTE_SET_ID_CUSTOMER,
80-
null,
80+
'Default',
8181
'${ATTRIBUTE_CODE}'
8282
);
8383

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
4+
namespace ${NAMESPACE};
5+
6+
use Magento\Framework\Event\ObserverInterface;
7+
use Magento\Framework\Event\Observer;
8+
9+
/**
10+
* Observes the `${EVENT_NAME}` event.
11+
*/
12+
class ${CLASS_NAME} implements ObserverInterface
13+
{
14+
/**
15+
* Observer for ${EVENT_NAME}.
16+
*
17+
* @param Observer $observer
18+
*
19+
* @return void
20+
*/
21+
public function execute(Observer $observer)
22+
{
23+
$event = $observer->getEvent();
24+
// TODO: Implement observer method.
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td>
12+
<font face="verdana" size="-1">Observers are a certain type of Magento class that can influence
13+
general behavior, performance, or change business logic. Observers are executed whenever the
14+
event they are configured to watch is dispatched by the event manager.
15+
<a href="https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html">
16+
Read more</a> about observers.
17+
</font>
18+
</td>
19+
</tr>
20+
<tr>
21+
<td>
22+
<font face="verdana" size="-1">Check out the
23+
<a href="https://devdocs.magento.com/guides/v2.3/ext-best-practices/extension-coding/observers-bp.html">
24+
Observers best practices</a> to have a clean and professional implementation.</font>
25+
</td>
26+
</tr>
27+
</table>
28+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
29+
<tr>
30+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
31+
</tr>
32+
<tr>
33+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
34+
<td width="10">&nbsp;</td>
35+
<td width="100%" valign="top"><font face="verdana" size="-1">Namespace for the class.</font></td>
36+
</tr>
37+
<tr>
38+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLASS_NAME}</b></font></nobr></td>
39+
<td width="10">&nbsp;</td>
40+
<td width="100%" valign="top"><font face="verdana" size="-1">Class name.</font></td>
41+
</tr>
42+
<tr>
43+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EVENT_NAME}</b></font></nobr></td>
44+
<td width="10">&nbsp;</td>
45+
<td width="100%" valign="top"><font face="verdana" size="-1">The name of the observer for the event definition.</font></td>
46+
</tr>
47+
</table>
48+
</body>
49+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
4+
namespace ${MODULE_NAME}\Setup\Patch\Data;
5+
6+
use Magento\Framework\Setup\ModuleDataSetupInterface;
7+
use Magento\Framework\Setup\Patch\DataPatchInterface;
8+
9+
/**
10+
* Patch is mechanism, that allows to do atomic upgrade data changes.
11+
*/
12+
class ${CLASS_NAME} implements DataPatchInterface
13+
{
14+
/**
15+
* @var ModuleDataSetupInterface
16+
*/
17+
private $moduleDataSetup;
18+
19+
/**
20+
* @param ModuleDataSetupInterface $moduleDataSetup
21+
*/
22+
public function __construct(
23+
ModuleDataSetupInterface $moduleDataSetup
24+
) {
25+
$this->moduleDataSetup = $moduleDataSetup;
26+
}
27+
28+
/**
29+
* Do Upgrade.
30+
*
31+
* @return void
32+
*/
33+
public function apply()
34+
{
35+
$this->moduleDataSetup->getConnection()->startSetup();
36+
37+
// TODO: The code that you want apply in the patch
38+
39+
$this->moduleDataSetup->getConnection()->endSetup();
40+
}
41+
42+
/**
43+
* Get aliases (previous names) for the patch.
44+
*
45+
* @return string[]
46+
*/
47+
public function getAliases()
48+
{
49+
return [];
50+
}
51+
52+
/**
53+
* Get array of patches that have to be executed prior to this.
54+
*
55+
* Example of implementation:
56+
*
57+
* [
58+
* \Vendor_Name\Module_Name\Setup\Patch\Patch1::class,
59+
* \Vendor_Name\Module_Name\Setup\Patch\Patch2::class
60+
* ]
61+
*
62+
* @return string[]
63+
*/
64+
public static function getDependencies()
65+
{
66+
return [];
67+
}
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td><font face="verdana" size="-1">
12+
A data patch is a class that contains data modification instructions.
13+
</font><br>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td><font face="verdana" size="-1">
18+
Read more About the data and schema patches in the
19+
<a href="https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/data-patches.html">
20+
DevDocs</a>.
21+
</font><br>
22+
</td>
23+
</tr>
24+
</table>
25+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
26+
<tr>
27+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
28+
</tr>
29+
<tr>
30+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLASS_NAME}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">Specifies the name of your class
33+
</font>
34+
</td>
35+
</tr>
36+
</table>
37+
</body>
38+
</html>

Diff for: resources/magento2/validation.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
validator.notEmpty=The {0} field must not be empty
22
validator.box.notEmpty=The {0} field must contain a valid selection from the dropdown
33
validator.package.validPath=Please specify a valid Magento 2 installation path
4+
validator.package.validPathComposerFiles=File composer.json is missing in the current Magento 2 installation path
5+
validator.package.validPathVendor=Vendor dir is corrupt or missing in the current Magento 2 installation path
46
validator.properties.notEmpty=The properties must not be empty
57
validator.alphaNumericCharacters=The {0} field must contain letters and numbers only
68
validator.alphaNumericAndUnderscoreCharacters={0} must contain letters, numbers and underscores only

0 commit comments

Comments
 (0)