Monday, April 8, 2013

PHPStorm - Supporting Factory methods in Magento

I'm pleased to present a new feature in new PhpStorm 6.0.1 EAP build 129.177/196 which supports generic Factory Method pattern.

How to use

So, all is ok but how to generate file .phpstorm.meta.php? We have good tool n98-magerun which can generate our needed file for Magento in the environment of PHPStorm.
So all we need that this command with expected result:

# php n98-magerun.phar dev:ide:phpstorm:meta
Generating definitions for blocks group
Generating definitions for helpers group
Generating definitions for models group
Generating definitions for resource helpers group
Generating definitions for resource models group
File .phpstorm.meta.php generated


That's all. Your IDE is supporting Magento Factory methods now. Also, in theory, this feature works for other libraries.

No comments: