Intellisense by only php comment without declaration

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Intellisense by only php comment without declaration

Postby kkoba » August 6th, 2013, 5:33 pm

I use CakePHP 2.0 that is one of PHP frameworks.
It generates class member automatically by its library feature.

For example;
Code: Select all
class BananasController extends AppController{
    /**
     * @var Banana $Banana description (I hope this comment information were recognized by Intallisense without declaring variable, but it doesn't.)
     */
    // public $Banana; // I want not to declare it because it is generated by framework.

    public function index()
    {
        // CakePHP generate "Banana" member whose type is Banana class.
        $this->Banana-> // I hope Intellisense works here.
    }
}


I want to suggest generated member information to PHP Tools Intellisense.
I first thought I can suggest it by comment, but Intellisense didn't recognize it without declaring variable explicitly.
I want not to declare it because it is generated by framework.

Is there a solution for it?
kkoba
 
Posts: 25
Joined: June 22nd, 2013, 11:13 am

Re: Intellisense by only php comment without declaration

Postby Jakub Misek » August 10th, 2013, 3:59 pm

According to PHPDoc specification, 'magic' class members can be declared by using @property and @method keywords.

See http://www.devsense.com/doc/phptools/ed ... c-comments (DOCUMENTING CLASS & CLASS MEMBERS) or http://manual.phpdoc.org/HTMLSmartyConv ... y.pkg.html for more details.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Intellisense by only php comment without declaration

Postby kkoba » August 10th, 2013, 6:01 pm

Thanks!
I fulfilled my aim by "@property" and "@method" comments!
Sorry for bothering you but I had not noticed "magic" keyword and has not been able to find any information for it.
My workspace got better by your advice. It's so great!
kkoba
 
Posts: 25
Joined: June 22nd, 2013, 11:13 am

Re: Intellisense by only php comment without declaration

Postby Jakub Misek » August 11th, 2013, 6:35 am

I'm glad it works.

Please let me know if there would be anything else we can do for your workspace!

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 11 guests

User Control Panel

Login

Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 5 minutes)
Most users ever online was 399 on April 19th, 2024, 11:49 pm

Users browsing this forum: No registered users and 11 guests