Skip to content

Commit 89ac533

Browse files
author
Vasilii Burlacu
committed
Merge remote-tracking branch 'origin/1.0.0-develop' into inspection-plugin-possible-duplication
2 parents dd8ac97 + 804b40b commit 89ac533

File tree

147 files changed

+4500
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+4500
-190
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* RequireJS mapping support (reference navigation, completion)
77
* Plugin class methods generation
88
* Plugin declaration inspection in the scope of a Plugin Class
9-
* MFTF support (reference navigation, completion)
9+
* MFTF support MVP (reference navigation, completion)
1010
* Fixed support of 2020.* versions of IDE's
1111
* Create a New Magento 2 Module action
1212
* Code Inspection: Duplicated Observer Usage in events XML
@@ -15,6 +15,10 @@
1515
* Create a Preference for a class action
1616
* Create a Block action
1717
* Line markers for navigation from a plugin class to a target class
18+
* Magento 2 Module Project template on the start up
19+
* Create an observer for an event action
20+
* Plugin - Target line markers
21+
* GraphQL resolver inspection in the scope of a PHP Class
1822

1923
0.3.0
2024
=============

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is a plugin for Magento 2 development in the PhpStorm IDE. It is available
1111
2. Navigate to `Plugins`
1212
3. Click the `Browse repositories...` button and search for "Magento PhpStorm"
1313
4. Install the plugin and restart PhpStorm
14-
5. Go to `Settings > Preferences > Languages & Frameworks > PHP > Magento` in the PhpStorm IDE
14+
5. Go to `Settings > Preferences > Languages & Frameworks > PHP > Frameworks > Magento` in the PhpStorm IDE
1515
6. Check `Enable` and `OK` button.
1616

1717
## Works with

resources/META-INF/plugin.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<group id="MagentoNewModuleFileGroup" class="com.magento.idea.magento2plugin.actions.groups.NewModuleFileGroup" text="Module File" popup="true">
5959
<action id="MagentoCreateABlock" class="com.magento.idea.magento2plugin.actions.generation.NewBlockAction" />
6060
<action id="MagentoCreateAViewModel" class="com.magento.idea.magento2plugin.actions.generation.NewViewModelAction" />
61+
<action id="MagentoCreateAGraphQlResolver" class="com.magento.idea.magento2plugin.actions.generation.NewGraphQlResolverAction" />
6162
<add-to-group group-id="NewGroup" anchor="last"/>
6263
</group>
6364

@@ -79,16 +80,12 @@
7980
</actions>
8081

8182
<extensions defaultExtensionNs="com.intellij">
82-
<projectConfigurable instance="com.magento.idea.magento2plugin.project.SettingsForm"
83-
id="Magento2.SettingsForm"
84-
displayName="Magento"
85-
nonDefaultProject="true"
86-
groupId="language"
87-
parentId="reference.webide.settings.project.settings.php"
88-
/>
83+
<directoryProjectGenerator implementation="com.magento.idea.magento2plugin.generation.MagentoModuleGenerator"/>
84+
<projectTemplatesFactory implementation="com.magento.idea.magento2plugin.generation.MagentoTemplatesFactory"/>
85+
8986
<projectService serviceImplementation="com.magento.idea.magento2plugin.project.Settings"/>
9087

91-
<completion.contributor language="XML" implementationClass="com.magento.idea.magento2plugin.completion.xml.XmlCompletionContributor" />
88+
<completion.contributor language="XML" implementationClass="com.magento.idea.magento2plugin.completion.xml.XmlCompletionContributor" id="xml" />
9289

9390
<psi.referenceContributor language="XML" implementation="com.magento.idea.magento2plugin.reference.xml.XmlReferenceContributor"/>
9491
<psi.referenceContributor language="PHP" implementation="com.magento.idea.magento2plugin.reference.php.PhpReferenceContributor"/>
@@ -162,4 +159,9 @@
162159
<internalFileTemplate name="Magento Module Events Xml"/>
163160
</extensions>
164161

162+
<extensions defaultExtensionNs="com.jetbrains.php">
163+
<frameworkProjectConfigurableProvider implementation="com.magento.idea.magento2plugin.project.ConfigurableProvider"/>
164+
<frameworkUsageProvider implementation="com.magento.idea.magento2plugin.project.UsagesProvider"/>
165+
</extensions>
166+
165167
</idea-plugin>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Resolve multiple requests.
3+
*
4+
* @param ContextInterface $context
5+
* @param Field $field
6+
* @param array $requests
7+
* @return BatchResponse
8+
*/
9+
public function resolve(
10+
ContextInterface $context,
11+
Field $field,
12+
array $requests
13+
): BatchResponse {
14+
// TODO: Implement resolve() method.
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
4+
#if (${NAMESPACE})
5+
6+
namespace ${NAMESPACE};
7+
8+
#end
9+
use Magento\Framework\GraphQl\Config\Element\Field;
10+
use Magento\Framework\GraphQl\Query\Resolver\BatchResolverInterface;
11+
use Magento\Framework\GraphQl\Query\Resolver\BatchResponse;
12+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
13+
14+
class ${NAME} implements BatchResolverInterface {
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
</body>
10+
</html>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html lang="en">
8+
<body>
9+
<font face="verdana" size="-1">
10+
<p>
11+
events.xml file is the place where module's Observers are declared to adjust the system.
12+
</p>
13+
<p>
14+
Read more about <a href="https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#subscribing-to-events">Subscribing to events</a>.
15+
</p>
16+
</font>
17+
18+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
19+
<tr>
20+
<td colspan="3"><font face="verdana" size="-1">Areas where events can be used:</font></td>
21+
</tr>
22+
<tr>
23+
<td valign="top"><b>Area</b></td>
24+
<td width="10"><b>Area Code</b></td>
25+
<td width="100%" valign="top"><b>Description</b></td>
26+
</tr>
27+
<tr>
28+
<td valign="top"><nobr><font face="verdana" size="-2"><b>Global</b></font></nobr></td>
29+
<td width="10">global</td>
30+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in all areas: adminhtml, crontab, frontend, graphql, webapi_rest, webapi_soap.</font></td>
31+
</tr>
32+
<tr>
33+
<td valign="top"><nobr><font face="verdana" size="-2"><b>Admin area</b></font></nobr></td>
34+
<td width="10">adminhtml</td>
35+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the adminhtml area only.</font></td>
36+
</tr>
37+
<tr>
38+
<td valign="top"><nobr><font face="verdana" size="-2"><b>Storefront</b></font></nobr></td>
39+
<td width="10">frontend</td>
40+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the frontend area only.</font></td>
41+
</tr>
42+
<tr>
43+
<td valign="top"><nobr><font face="verdana" size="-2"><b>Cron</b></font></nobr></td>
44+
<td width="10">crontab</td>
45+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the crontab area only.</font></td>
46+
</tr>
47+
<tr>
48+
<td valign="top"><nobr><font face="verdana" size="-2"><b>GraphQl</b></font></nobr></td>
49+
<td width="10">graphql</td>
50+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the graphql area only.</font></td>
51+
</tr>
52+
<tr>
53+
<td valign="top"><nobr><font face="verdana" size="-2"><b>REST API</b></font></nobr></td>
54+
<td width="10">webapi_rest</td>
55+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the webapi_rest area only.</font></td>
56+
</tr>
57+
<tr>
58+
<td valign="top"><nobr><font face="verdana" size="-2"><b>SOAP API</b></font></nobr></td>
59+
<td width="10">webapi_soap</td>
60+
<td width="100%" valign="top"><font face="verdana" size="-1">Observer will be executed in the webapi_soap area only,</font></td>
61+
</tr>
62+
</table>
63+
</body>
64+
</html>

resources/fileTemplates/internal/Magento Observer Class.php.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ use Magento\Framework\Event\ObserverInterface;
1010
use Magento\Framework\Event\Observer;
1111

1212
class ${NAME} implements ObserverInterface {
13-
}
13+
}
Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
11
<!--
2-
/*
2+
/**
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<html>
8-
<body>
9-
</body>
7+
<html lang="en">
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+
29+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
30+
<tr>
31+
<td colspan="3"><font face="verdana" size="-1">Template's variables:</font></td>
32+
</tr>
33+
<tr>
34+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
35+
<td width="10">&nbsp;</td>
36+
<td width="100%" valign="top"><font face="verdana" size="-1">Created PHP observer class namespace.</font></td>
37+
</tr>
38+
<tr>
39+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
40+
<td width="10">&nbsp;</td>
41+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP class for the observer name.</font></td>
42+
</tr>
43+
</table>
44+
</body>
1045
</html>

0 commit comments

Comments
 (0)