NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Allow integrated tools to advise code insight


Joined: 23 Feb 2011
Posts: 2
Reply with quote
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:

Code:
//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.)
View user's profileFind all posts by BrilliandSend private message
Allow integrated tools to advise code insight
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic