NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] Issue with code completion?


Joined: 15 May 2007
Posts: 3
Reply with quote
This being my first post, I'd like to say how impressed I am with PhpED. I've used ZDE for the last 3 years and tried out PhpED about three days ago for the heck of it, and ended up liking it...a lot. It's responsiveness and smaller memory footprint is very nice, as well as the additional features you get. I'll be purchasing the Professional version here soon.

Now to the problem, explained in comments in the code:

noname1.php
Code:
<?php
class Object {
    public function __construct($objectId) {
        // bleh
    }

    /**
     * Tried with both @return and @returns
     *
     *
     * @returns Object
     */
    static public function singleton($objectId) {
        static $objects;

        if (is_null($objects)) {
            $objects = array();
        }

        if (is_null($objects[$objectId])) {
            $objects[$objectId] = new Object($objectId);
        }

        // tried with and without the following hint
        /** @var Object */
    return $objects[$objectId];
    }
}
?>


noname2.php
Code:
<?php
class Instance {
    /**
     * @var Object
     */
    public $objectType;

    public function __construct($instanceId) {
        $this->objectType = Object::singleton(1); // other logic would be in this method to obtain the object type id
        $this->objectType-> // code completion fails, however if i use $this->objectType = new Object(1);, completion works
    }
}
?>


This seems to be an issue with the name of my class being "Object", because if I change the class name to "Objectz" along with the hints, it works great. I've tried this with both classes in the same file and get the same result. I know I could just go ahead and change my class name but I'd really prefer not to.

Anyone run into this before? I wasn't able to find anything regarding this in my forum searches.
View user's profileFind all posts by webm4st0rSend private messageAIM Address
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Thanks for the report.
Hope we'll fix it in the next build (5023)

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 May 2007
Posts: 3
Reply with quote
Thanks dmitri, I see you're a great help on the forums. Do you guys have an estimated timeframe for the next release?
View user's profileFind all posts by webm4st0rSend private messageAIM Address
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
normally, immediately after the major release we release a few minor updates, approximately one in a week.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 May 2007
Posts: 3
Reply with quote
Cool deal, thanks for the info.
View user's profileFind all posts by webm4st0rSend private messageAIM Address
[resolved] Issue with 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