Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347585

Summary: @method tag not working with static methods
Product: z_Archived Reporter: Giorgio Liscio <giorgio.liscio>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: silviya, zhaozhongwei, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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"