Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347585 - @method tag not working with static methods
Summary: @method tag not working with static methods
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-29 14:11 EDT by Giorgio Liscio CLA
Modified: 2020-05-14 11:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giorgio Liscio CLA 2011-05-29 14:11:18 EDT
Build Identifier: Build id: 20110218-0911

hi, see the difference between a static and a non-static method:

	abstract class MyAbstract
	{
		/**
		 * @return MyAbstract
		 */
		static function getInstance(){}
		/**
		 * @return MyAbstract
		 */
		function nonStaticMethod(){}
	}
	
	/**
	 * @method Concrete getInstance()
	 * @method Concrete nonStaticMethod()
	 */
	class Concrete extends MyAbstract
	{
		
	}
	
	$aa = new Concrete();
	$aa->  // here works (with non static methods)
	Concrete:: //here i aspect to see "getInstance" but no code suggest is proposed

thank you

Reproducible: Always
Comment 1 Giorgio Liscio CLA 2011-06-12 06:51:57 EDT
still buggy in indigo/pdt3.0
Comment 2 Dawid Pakula CLA 2014-02-18 19:58:24 EST
By @method you override default PDT behaviour.

PHPDoc @method and @property tags are for "magic" methods/properties.

So please remove your @method lines , and try run ctr/cmd + space again ;)
Comment 3 Dawid Pakula CLA 2015-03-25 08:47:09 EDT
In PDT 3.5 we introduced "@method static ReturnType methodName()" (like in PHPStorm and netbeans).
Comment 4 Sylvia Tancheva CLA 2015-05-19 04:52:22 EDT
Works now with static (closing the bug):

<?php

abstract class MyAbstract
{

    /**
     *
     * @return MyAbstract
     */
    static function getInstance()
    {}

    /**
     *
     * @return MyAbstract
     */
    function nonStaticMethod()
    {}
}

/**
 *
 * @method static Concrete getInstance()
 * @method Concrete nonStaticMethod()
 */
class Concrete extends MyAbstract
{
}

$aa = new Concrete();
Concrete:: // Now shows "getInstance"