|WORK IN PROGRESS|
As discussed at WI-6027 Generic support for factory design pattern in PHP chaining (e.g. Magento, Doctrine, Kohana, etc..)
Fragment below is example metadata for Magento project. It can reside anywhere, but we recommend using .phpstorm.meta.php file in project root.
We use PHP code as a config - so we can use existing API to analyse it. The specific format is chosen also to facilitate existing editor features to help as much as possible - completion works, references are resolved, usage search and refactoring will work too.