4.0.0 Release - magento/magento2-phpstorm-plugin GitHub Wiki
What's new in Magento PHPStorm Plugin 4.0.0
This release contains new issue reporting feature, added XML file header include code template, improved UX with generation dialogs GUI, new code generators, new code inspections, extended Copy Magento Path action, extended Entity Creator feature, fixed bugs, added support of IDEA(PhpStorm) 2021.2.1.
Code generation
XML file header
The new include code template was added to the generated with the plugin XML files.
To configure it go to the Preferences -> Editor -> File and Code Templates -> Includes -> XML File Header
:
Usage
Any generated XML file will have this header, as for example:
Web API declaration generation
Web API interface for service (PHP class) generation
Web API generation for the Magento Entity Creator
From now on, the Entity Creator feature also includes the Web API generation.
There is an example of the output for generated entity when accessing get list REST API endpoint from the Postman application and from the admin panel in browser:
Code inspection
Web API XML service tag attributes inspections
DI XML preference tag attributes inspections
DI XML type tag attributes inspections that related to the PHP/Magento types
The Type
tag inspections (in the di.xml files) detect empty values or invalid values where a Type values (class, interface, virtual type) are expected.
It also supports recursive inspection for xsi:type="array"
arguments.
DI XML plugin type attribute inspections
Extra
Issue reporting
Implemented extension point for errorHandler to integrate plugin with the IDE's dialog to report fatal errors.
Usage
-
When an issue occurred click on the
See details and submit report
link for reporting an issue. -
Fill the issue description and click on the
Report Me
button:
- Change the auto generated issue title to the proper one:
- Fill the rest with available information about an issue (such as steps to reproduce, expected behaviour etc.) and click on the
Submit new issue
button:
JS and CSS support for Copy Magento Path action
Ability to copy Magento Path for JS files.
Ability to copy Magento Path for CSS files.
Changed the content of the generated plugin class
Changed using of hardcoded entity id value into the constant in all files generated by the Entity Creator
Bugfixes
- A casting exception in the XML index.
- Incorrect plugin generation for complex non-primitive types.
- Incorrect namespace generation in a generated controller.
- Incorrect directory validation for the generation dialogues.
- Wrong entity data mapper file template position.
- Incorrect data saving into table model within editing a table.
- An error when plugin or observer name is not set.
- Incorrect duplication warning for disabled plugin in di.xml.