{"action":"opened","issue":{"url":"https://api.github.com/repos/dkvashninbay/magento2plugin/issues/5","labels_url":"https://api.github.com/repos/dkvashninbay/magento2plugin/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/dkvashninbay/magento2plugin/issues/5/comments","events_url":"https://api.github.com/repos/dkvashninbay/magento2plugin/issues/5/events","html_url":"https://github.com/dkvashninbay/magento2plugin/issues/5","id":121184223,"number":5,"title":"Feature: Type Hinting / Completion for generic Factories","user":{"login":"davidverholen","id":2813693,"avatar_url":"https://avatars.githubusercontent.com/u/2813693?v=3","gravatar_id":"","url":"https://api.github.com/users/davidverholen","html_url":"https://github.com/davidverholen","followers_url":"https://api.github.com/users/davidverholen/followers","following_url":"https://api.github.com/users/davidverholen/following{/other_user}","gists_url":"https://api.github.com/users/davidverholen/gists{/gist_id}","starred_url":"https://api.github.com/users/davidverholen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidverholen/subscriptions","organizations_url":"https://api.github.com/users/davidverholen/orgs","repos_url":"https://api.github.com/users/davidverholen/repos","events_url":"https://api.github.com/users/davidverholen/events{/privacy}","received_events_url":"https://api.github.com/users/davidverholen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-09T08:11:41Z","updated_at":"2015-12-09T08:11:41Z","closed_at":null,"body":"Hey,\r\n\r\nwould it be possible to add recognization for magento2's generic Factories?\r\n\r\nFor example:\r\n\r\nIf I have a Model: \\Vendor\\Module\\Model\\Object\r\nThen I can create a new Instance by this Object by Injecting the Factory:\r\n\\Vendor\\Module\\Model\\ObjectFactory\r\n\r\nThe Factory does not exist and is created by Magento's ObjectManager when requested.\r\n\r\nThe Factory has a create() method that returns a new Instance of \\Vendor\\Module\\Model\\Object\r\n\r\nExample for generated Class in var/generation:\r\n\r\n``` php\r\n<?php\r\nnamespace Vendor\\Module\\Model;\r\n\r\n/**\r\n * Factory class for @see \\Vendor\\Module\\Model\\Object\r\n */\r\nclass ObjectFactory\r\n{\r\n    /**\r\n     * Object Manager instance\r\n     *\r\n     * @var \\Magento\\Framework\\ObjectManagerInterface\r\n     */\r\n    protected $_objectManager = null;\r\n\r\n    /**\r\n     * Instance name to create\r\n     *\r\n     * @var string\r\n     */\r\n    protected $_instanceName = null;\r\n\r\n    /**\r\n     * Factory constructor\r\n     *\r\n     * @param \\Magento\\Framework\\ObjectManagerInterface $objectManager\r\n     * @param string $instanceName\r\n     */\r\n    public function __construct(\\Magento\\Framework\\ObjectManagerInterface $objectManager, $instanceName = '\\\\Vendor\\\\Module\\\\Model\\\\Object')\r\n    {\r\n        $this->_objectManager = $objectManager;\r\n        $this->_instanceName = $instanceName;\r\n    }\r\n\r\n    /**\r\n     * Create class instance with specified parameters\r\n     *\r\n     * @param array $data\r\n     * @return \\Vendor\\Module\\Model\\Object\r\n     */\r\n    public function create(array $data = array())\r\n    {\r\n        return $this->_objectManager->create($this->_instanceName, $data);\r\n    }\r\n}\r\n```\r\n\r\nVery helpful Plugin,\r\nthanks for that btw!"}}