Skip to content

Commit 4a6818c

Browse files
author
Vitaliy Boyko
committed
Merge branch '2.1.0-develop' of github.com:magento/magento2-phpstorm-plugin into 3.0.0-develop
2 parents 8496f52 + 3e2514c commit 4a6818c

File tree

6 files changed

+187
-28
lines changed

6 files changed

+187
-28
lines changed

resources/fileTemplates/internal/Magento Form Button Block Class.php.html

+26-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@
55
*/
66
-->
77
<html lang="en">
8-
<body>
9-
</body>
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">
13+
A Magento 2 <a href="https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-form.html">UI Component Form</a> can have buttons to perform actions on the form such as "Back" or "Save" for example.
14+
</font><br>
15+
</td>
16+
</tr>
17+
</table>
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">Predefined variables will take the following values:</font></td>
21+
</tr>
22+
<tr>
23+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
24+
<td width="10">&nbsp;</td>
25+
<td width="100%" valign="top"><font face="verdana" size="-1">Namespace for the UI Component Form button class</font></td>
26+
</tr>
27+
<tr>
28+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLASS_NAME}</b></font></nobr></td>
29+
<td width="10">&nbsp;</td>
30+
<td width="100%" valign="top"><font face="verdana" size="-1">Class name for the UI Component Form button class</font></td>
31+
</tr>
32+
</table>
33+
</body>
1034
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
Magento uses an active record pattern strategy for persistence. In this system, the model object contains a resource model that maps an object to one or more database rows. A resource model is responsible for performing functions such as: Executing all CRUD (create, read, update, delete) requests.
13+
</font><br>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td><font face="verdana" size="-1">
18+
Link to documentation
19+
<a href="https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/persist_layer.html?itm_source=devdocs&itm_medium=quick_search&itm_campaign=federated_search&itm_term=Resource%20Mode">
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>${NAMESPACE}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">A fully qualified name of the field namespace without a leading slash.
33+
</font>
34+
</td>
35+
</tr>
36+
<tr>
37+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${USE}</b></font></nobr></td>
38+
<td width="10">&nbsp;</td>
39+
<td width="100%" valign="top"><font face="verdana" size="-1">List of imports separated by comma.
40+
</font>
41+
</td>
42+
</tr>
43+
<tr>
44+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
45+
<td width="10">&nbsp;</td>
46+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class name.
47+
</font>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EXTENDS}</b></font></nobr></td>
52+
<td width="10">&nbsp;</td>
53+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of the PHP class that the Class extends.
54+
</font>
55+
</td>
56+
</tr>
57+
<tr>
58+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${IMPLEMENTS}</b></font></nobr></td>
59+
<td width="10">&nbsp;</td>
60+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of the PHP class that the Class implements.
61+
</font>
62+
</td>
63+
</tr>
64+
<tr>
65+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${DB_NAME}</b></font></nobr></td>
66+
<td width="10">&nbsp;</td>
67+
<td width="100%" valign="top"><font face="verdana" size="-1">Target table name.
68+
</font>
69+
</td>
70+
</tr>
71+
<tr>
72+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${ENTITY_ID_COLUMN}</b></font></nobr></td>
73+
<td width="10">&nbsp;</td>
74+
<td width="100%" valign="top"><font face="verdana" size="-1">Target table's primary column name.
75+
</font>
76+
</td>
77+
</tr>
78+
</table>
79+
</body>
80+
</html>

resources/fileTemplates/internal/Magento UI Component Form XML.xml.html

+1-26
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,5 @@
55
*/
66
-->
77
<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">
13-
A Magento 2 <a href="https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-form.html">UI Component Form</a> can have buttons to perform actions on the form such as "Back" or "Save" for example.
14-
</font><br>
15-
</td>
16-
</tr>
17-
</table>
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">Predefined variables will take the following values:</font></td>
21-
</tr>
22-
<tr>
23-
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
24-
<td width="10">&nbsp;</td>
25-
<td width="100%" valign="top"><font face="verdana" size="-1">Namespace for the UI Component Form button class</font></td>
26-
</tr>
27-
<tr>
28-
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CLASS_NAME}</b></font></nobr></td>
29-
<td width="10">&nbsp;</td>
30-
<td width="100%" valign="top"><font face="verdana" size="-1">Class name for the UI Component Form button class</font></td>
31-
</tr>
32-
</table>
33-
</body>
8+
<body></body>
349
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Plugin\Block;
8+
9+
class Topmenu
10+
{
11+
public function aroundSomeMethod(\Magento\Theme\Block\Html\Topmenu $subject, \Magento\Theme\Block\Html\Topmenu $proceed)
12+
{
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Plugin\Block;
8+
9+
class Topmenu
10+
{
11+
public function aroundSomeMethod(\Magento\Catalog\Block\Navigation $subject, callable $proceed)
12+
{
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.inspections.php;
7+
8+
import com.jetbrains.php.PhpBundle;
9+
10+
public class PluginInspectionTest extends InspectionPhpFixtureTestCase {
11+
12+
@Override
13+
public void setUp() throws Exception {
14+
super.setUp();
15+
myFixture.enableInspections(PluginInspection.class);
16+
}
17+
18+
@Override
19+
protected boolean isWriteActionRequired() {
20+
return false;
21+
}
22+
23+
/**
24+
* Inspection highlights error in parameter type.
25+
*/
26+
public void testWithWrongParameterType() {
27+
myFixture.configureByFile(getFixturePath("Plugin.php"));
28+
29+
final String wrongParameterError = PhpBundle.message(
30+
"inspection.wrong_param_type",
31+
"\\Magento\\Catalog\\Block\\Navigation",
32+
"\\Magento\\Theme\\Block\\Html\\Topmenu"
33+
);
34+
35+
assertHasHighlighting(wrongParameterError);
36+
}
37+
38+
/**
39+
* Inspection highlights error in callable parameter type.
40+
*/
41+
public void testWithWrongCallableType() {
42+
myFixture.configureByFile(getFixturePath("Plugin.php"));
43+
44+
final String wrongParameterError = PhpBundle.message(
45+
"inspection.wrong_param_type",
46+
"\\Magento\\Theme\\Block\\Html\\Topmenu",
47+
"callable"
48+
);
49+
50+
assertHasHighlighting(wrongParameterError);
51+
}
52+
}

0 commit comments

Comments
 (0)