This is a solution to the following request, which isn't as impossible as it was made out to be:
Script for code-insight for Factory created objects?
While it's technically impossible to figure out what factory methods will do in every case, some cases can be handled by simply executing the code a little ways, and more (theoretically all) can be handled by allowing the user to set the rules - i.e. via an integrated tool. For example, here's a script that I wrote that echoes the classname for a snippet of code in my particular environment:
//Prepare the environment
require_once "../magento/app/Mage.php";
Mage::app();
//Execute the code and get the class
$class = get_class(eval('return '.trim(file_get_contents('php://stdin')).';'));
echo $class |
Now... could I get the ability to have this snippet of code tell code insight what the return class of a method will be?
(This script does have its risks, so I may replace it with one that's regular expression-based... but that needn't make a difference to PhpED.)