NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
What about standards object's returns? + code completion
Veteran

Joined: 06 Mar 2007
Posts: 158
Location: Poland
Reply with quote
Hi NuSphere Team

If someone else has just been writing about it, sorry Smile


Please look at a below lines:

$link = new mysqli('host','user','pass','database');
$link->[OK!] // here code completion works
$result = $link->query("query");
$result->[NOTHING!] // here code completion does not work

... and here nothing happens. Why when $link->query returns mysqli_result object there are no code completion for it?


Please look at a below test:

class T_mysqli_result
{
public function close()
{ }
public function fetch_array()
{ }
// ...
}
class T_mysqli
{
function __construct($h,$u,$p,$d)
{ }
public function query($q)
{ return new T_mysqli_result; }
// ...
}

$link = new T_mysqli('host','user','pass','database');
$link->[OK!]
$result = $link->query();
$result->[OK!]

... and here code completion works perfectly and shows all available methods and properties of T_mysqli_result.

And now please look at a below next small test:

$link = new mysqli('host','user','pass','database');
$result = $link->query("query");
DoSthWithResult($result);
function DoSthWithResult(mysqli_result $result)
{
$result->[OK!]
}

... and here code completion also works.


Why in the first of above examples code completion does not work for standard classes? Is possible to correct it in next nearly versions of PhpED?

Regards and Respect

_________________
ML
View user's profileFind all posts by introSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
$result = $link->query("query");
$result->[NOTHING!] // here code completion does not work

please check php manual.
Query returns TRUE, FALSE or somewhat called "result object" for SELECT, SHOW, DESCRIBE and EXPLAIN.
Now please read you code again. Is it clear what query will return in your case?

Quote:
... and here code completion works perfectly and shows all available methods and properties of T_mysqli_result.

sure. It works perfectly well.

Quote:
Why in the first of above examples code completion does not work for standard classes?

It works for all standard (pre-defined) classes exactly in a way they are defined. And they are defined according to php manual.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
What about standards object's returns? + code completion
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