Skip to content

Commit bbb9fc6

Browse files
authored
Merge branch '5.1.0-develop' into 1215-number-fromat-exception-empty-string
2 parents 1f5d874 + f586f25 commit bbb9fc6

File tree

79 files changed

+2151
-116
lines changed

Some content is hidden

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

79 files changed

+2151
-116
lines changed

CHANGELOG.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,28 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7-
## 4.4.1
7+
## 5.1.0
8+
9+
## 5.0.0
10+
11+
### Added
12+
13+
- Code generation of a Data Patch Boilerplate file [#1188](https://github.com/magento/magento2-phpstorm-plugin/pull/1188)
14+
- Code generation of an Observer from the context menu [#1200](https://github.com/magento/magento2-phpstorm-plugin/pull/1200)
15+
- Code generation of events.xml file [#1189](https://github.com/magento/magento2-phpstorm-plugin/pull/1189)
16+
- Config Scope directory inspection [#1261](https://github.com/magento/magento2-phpstorm-plugin/pull/1261)
17+
18+
### Changed
19+
20+
- EAV attributes code generators: Added default values of the group property [#1259](https://github.com/magento/magento2-phpstorm-plugin/pull/1259)
21+
- All code generators: Added constants visibility and class property types [#1260](https://github.com/magento/magento2-phpstorm-plugin/pull/1260)
22+
- UCT custom coming versions [#1251](https://github.com/magento/magento2-phpstorm-plugin/pull/1251)
823

924
### Fixed
1025

1126
- Fixed wrong director(y|ies) generation for GraphQL resolver class [#1192](https://github.com/magento/magento2-phpstorm-plugin/pull/1192)
1227
- Fixed IndexOutOfBoundsException: CreateResolverClassQuickFix.applyFix(CreateResolverClassQuickFix.java:43) [#1192](https://github.com/magento/magento2-phpstorm-plugin/pull/1192)
28+
- Index out of range [#1239](https://github.com/magento/magento2-phpstorm-plugin/pull/1239)
1329

1430
## 4.4.0
1531

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
1. Check out this repository
4444
1. Open a folder with the project in the IntelliJ Ultimate using the `open` action button.
45-
1. Make sure that you on the latest develop branch (e.g `4.4.1-develop`)
45+
1. Make sure that you on the latest develop branch (e.g `5.1.0-develop`)
4646
1. Right-click on the `build.gradle` file, choose "Import Gradle project" (if this is not exist look for "Build module '<root folder name>'") (you need to have Gradle plugin installed)
4747
1. Check if the right SDK version is used for the project.
4848
- Current Java version for the project is **java 11**, so you should additionally download **SDK 11** and choose it in the module settings: `Right click by the project root > Open Module Settings > Project Settings > Project > Project SDK`

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repositories {
1515
}
1616

1717
group 'com.magento.idea'
18-
version '4.4.1'
18+
version '5.1.0'
1919

2020
apply plugin: 'org.jetbrains.intellij'
2121
apply plugin: 'java'

resources/META-INF/plugin.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin require-restart="true">
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>4.4.1</version>
10+
<version>5.1.0</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[
@@ -64,6 +64,7 @@
6464
<action id="MagentoCreateCrontabFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewCrontabXmlAction"/>
6565
<action id="MagentoCreateDiFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewDiXmlAction"/>
6666
<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"/>
6768
<action id="MagentoCreateExtensionAttributesFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewExtensionAttributesXmlAction"/>
6869
<action id="MagentoCreateFieldsetFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewFieldsetXmlAction"/>
6970
<action id="MagentoCreateIndexerFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewIndexerXmlAction"/>
@@ -77,6 +78,8 @@
7778
<action id="MagentoCreateWidgetFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewWidgetXmlAction"/>
7879
<action id="MagentoCreateLayoutFile" class="com.magento.idea.magento2plugin.actions.context.xml.NewLayoutXmlAction"/>
7980
<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"/>
8083
<!-- Context dependent actions -->
8184
<separator/>
8285
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewXml"/>
@@ -312,6 +315,13 @@
312315
enabledByDefault="true" level="WARNING"
313316
implementationClass="com.magento.idea.magento2plugin.inspections.xml.PluginAttributeTypeInspection"/>
314317

318+
<localInspection language="XML" groupPath="XML"
319+
shortName="ModuleScopeInspection"
320+
bundle="magento2.inspection" key="inspection.displayName.ModuleScopeInspection"
321+
groupBundle="magento2.inspection" groupKey="inspection.group.name"
322+
enabledByDefault="true" level="WARNING"
323+
implementationClass="com.magento.idea.magento2plugin.inspections.xml.ModuleScopeInspection"/>
324+
315325
<!-- UCT inspection -->
316326
<localInspection language="PHP" groupPath="UCT"
317327
shortName="ExtendingDeprecatedClass"

resources/fileTemplates/internal/Magento Backend Controller Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
1515
/**
1616
* Authorization level of a basic admin session
1717
*/
18-
const ADMIN_RESOURCE = '${ACL}';
18+
public const ADMIN_RESOURCE = '${ACL}';
1919

2020
#end
2121
/**

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

+19-19
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@ use $use;
1212
class ${CLASS_NAME} implements ${IMPLEMENTS}
1313
{
1414
/**
15-
* @var ${MODULE_DATA_SETUP_INTERFACE}
16-
*/
17-
private $moduleDataSetup;
15+
* @var ${MODULE_DATA_SETUP_INTERFACE}
16+
*/
17+
private ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup;
1818

19-
/**
20-
* @var ${EAV_SETUP_FACTORY}
21-
*/
22-
private $eavSetupFactory;
19+
/**
20+
* @var ${EAV_SETUP_FACTORY}
21+
*/
22+
private ${EAV_SETUP_FACTORY} $eavSetupFactory;
2323

2424
/**
25-
* @var ${EAV_CONFIG_CLASS}
26-
*/
27-
private $eavConfig;
25+
* @var ${EAV_CONFIG_CLASS}
26+
*/
27+
private ${EAV_CONFIG_CLASS} $eavConfig;
2828

2929
/**
30-
* @var ${ATTRIBUTE_RESOURCE}
31-
*/
32-
private $attributeResource;
30+
* @var ${ATTRIBUTE_RESOURCE}
31+
*/
32+
private ${ATTRIBUTE_RESOURCE} $attributeResource;
3333

34-
/**
35-
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup
36-
* @param ${EAV_SETUP_FACTORY} $eavSetupFactory
37-
* @param ${EAV_CONFIG_CLASS} $eavConfig
38-
* @param ${ATTRIBUTE_RESOURCE} $attributeResource
39-
*/
34+
/**
35+
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup
36+
* @param ${EAV_SETUP_FACTORY} $eavSetupFactory
37+
* @param ${EAV_CONFIG_CLASS} $eavConfig
38+
* @param ${ATTRIBUTE_RESOURCE} $attributeResource
39+
*/
4040
public function __construct(
4141
${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup,
4242
${EAV_SETUP_FACTORY} $eavSetupFactory,

resources/fileTemplates/internal/Magento Data Model Interface.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ${NAME}
1616
#set ($propertyData = $property.split(";"))
1717
#set ($propertyUpperSnake = $propertyData.get(0))
1818
#set ($propertyLowerSnake = $propertyData.get(1))
19-
const $propertyUpperSnake = "$propertyLowerSnake";
19+
public const $propertyUpperSnake = "$propertyLowerSnake";
2020
#end
2121
#end
2222
#if (${PROPERTIES})

resources/fileTemplates/internal/Magento Data Model.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
2626
#set ($propertyData = $property.split(";"))
2727
#set ($propertyUpperSnake = $propertyData.get(0))
2828
#set ($propertyLowerSnake = $propertyData.get(1))
29-
const $propertyUpperSnake = "$propertyLowerSnake";
29+
public const $propertyUpperSnake = "$propertyLowerSnake";
3030
#end
3131

3232
#end

resources/fileTemplates/internal/Magento Delete Entity By Id Command.php.ft

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ class ${CLASS_NAME}
1616
/**
1717
* @var ${LOGGER}
1818
*/
19-
private $logger;
19+
private ${LOGGER} $logger;
2020

2121
/**
2222
* @var ${MODEL_FACTORY}
2323
*/
24-
private $modelFactory;
24+
private ${MODEL_FACTORY} $modelFactory;
2525

2626
/**
2727
* @var ${RESOURCE}
2828
*/
29-
private $resource;
29+
private ${RESOURCE} $resource;
3030

3131
/**
3232
* @param ${LOGGER} $logger

resources/fileTemplates/internal/Magento Eav Attribute Data Patch Class.php.ft

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class ${CLASS_NAME} implements ${IMPLEMENTS} {
1515
/**
1616
* @var ${MODULE_DATA_SETUP_INTERFACE}
1717
*/
18-
private $moduleDataSetup;
18+
private ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup;
1919

2020
/**
2121
* @var ${EAV_SETUP_FACTORY}
2222
*/
23-
private $eavSetupFactory;
23+
private ${EAV_SETUP_FACTORY} $eavSetupFactory;
2424

2525
/**
2626
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup

resources/fileTemplates/internal/Magento Entity Data Mapper.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ${CLASS_NAME}
1616
/**
1717
* @var ${DTO_FACTORY}
1818
*/
19-
private $entityDtoFactory;
19+
private ${DTO_FACTORY} $entityDtoFactory;
2020

2121
/**
2222
* @param ${DTO_FACTORY} $entityDtoFactory

resources/fileTemplates/internal/Magento Entity Delete Controller Class.php.ft

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS_POST}, ${IMPLEMEN
1818
*
1919
* @see _isAllowed()
2020
*/
21-
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
21+
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
2222

2323
/**
2424
* @var ${DELETE_COMMAND}
2525
*/
26-
private $deleteByIdCommand;
26+
private ${DELETE_COMMAND} $deleteByIdCommand;
2727

2828
/**
2929
* @param Context $context

resources/fileTemplates/internal/Magento Entity Edit Action Controller Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
1818
*
1919
* @see _isAllowed()
2020
*/
21-
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
21+
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
2222

2323
/**
2424
* Edit ${ENTITY_NAME} action.

resources/fileTemplates/internal/Magento Entity Index Adminhtml Controller Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ${CLASS_NAME} extends ${PARENT_CLASS_NAME} implements ${HTTP_GET_METHOD}
1616
/**
1717
* Authorization level of a basic admin session.
1818
*/
19-
const ADMIN_RESOURCE = '${ACL}';
19+
public const ADMIN_RESOURCE = '${ACL}';
2020

2121
/**
2222
* Execute action based on request and return result.

resources/fileTemplates/internal/Magento Entity New Action Controller Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
1818
*
1919
* @see _isAllowed()
2020
*/
21-
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
21+
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
2222

2323
/**
2424
* Create new ${ENTITY_NAME} action.

resources/fileTemplates/internal/Magento Entity Save Controller Class.php.ft

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
1818
*
1919
* @see _isAllowed()
2020
*/
21-
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
21+
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
2222

2323
/**
2424
* @var ${DATA_PERSISTOR}
2525
*/
26-
private $dataPersistor;
26+
private ${DATA_PERSISTOR} $dataPersistor;
2727

2828
/**
2929
* @var ${SAVE_COMMAND}
3030
*/
31-
private $saveCommand;
31+
private ${SAVE_COMMAND} $saveCommand;
3232

3333
/**
3434
* @var ${ENTITY_DTO_FACTORY}
3535
*/
36-
private $entityDataFactory;
36+
private ${ENTITY_DTO_FACTORY} $entityDataFactory;
3737

3838
/**
3939
* @param Context $context

resources/fileTemplates/internal/Magento Get List Query Model.php.ft

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ class ${CLASS_NAME}
1616
/**
1717
* @var ${COLLECTION_PROCESSOR_TYPE}
1818
*/
19-
private $collectionProcessor;
19+
private ${COLLECTION_PROCESSOR_TYPE} $collectionProcessor;
2020

2121
/**
2222
* @var ${ENTITY_COLLECTION_FACTORY_TYPE}
2323
*/
24-
private $entityCollectionFactory;
24+
private ${ENTITY_COLLECTION_FACTORY_TYPE} $entityCollectionFactory;
2525

2626
/**
2727
* @var ${ENTITY_DATA_MAPPER_TYPE}
2828
*/
29-
private $entityDataMapper;
29+
private ${ENTITY_DATA_MAPPER_TYPE} $entityDataMapper;
3030

3131
/**
3232
* @var ${SEARCH_CRITERIA_BUILDER_TYPE}
3333
*/
34-
private $searchCriteriaBuilder;
34+
private ${SEARCH_CRITERIA_BUILDER_TYPE} $searchCriteriaBuilder;
3535

3636
/**
3737
* @var ${SEARCH_RESULT_FACTORY_TYPE}
3838
*/
39-
private $searchResultFactory;
39+
private ${SEARCH_RESULT_FACTORY_TYPE} $searchResultFactory;
4040

4141
/**
4242
* @param ${COLLECTION_PROCESSOR_TYPE} $collectionProcessor

resources/fileTemplates/internal/Magento Grid Ui Component Action Column Class.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ${CLASS_NAME} extends ${PARENT_CLASS}
2727
/**
2828
* @var ${URL}
2929
*/
30-
private $urlBuilder;
30+
private ${URL} $urlBuilder;
3131

3232
/**
3333
* @param ${CONTEXT} $context
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>

0 commit comments

Comments
 (0)