Bug 528544 - Error when adding a PHPDocumentor block on an inherited method
Summary: Error when adding a PHPDocumentor block on an inherited method
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-12 11:21 EST by Samuel Sol CLA
Modified: 2020-05-14 10:16 EDT (History)
1 user (show)

See Also:


Attachments
Error log (6.11 KB, application/octet-stream)
2017-12-12 11:21 EST, Samuel Sol CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Sol CLA 2017-12-12 11:21:49 EST
Created attachment 271869 [details]
Error log

Greetings everyone,

After upgrade from neon.3 to oxygen.1, the Code Template for Comments > Overriding methods stopped working. This is a new workspace not an upgraded one, although the templates were imported from a previous version. This worked normally on Neon.3.

The pattern used on the template is :

/**
 * {@inheritDoc}
 * ${see_to_overridden}
 */

Steps to Reproduce
==================
Create a class that extends another, create an overriding method, on the line above it type /** and press enter;


Expected Results
================
It should complete the PHPDoc block writting:

/**
 * {@inheritDoc}
 * @see className::methodName()
 */


Actual Results
==============
/**

 */

Only the above part is written and an error is thrown on the log. The error is attached to this report
Comment 1 Thierry BLIND CLA 2017-12-14 05:12:12 EST
Hi Samuel,
I tried to reproduce your problem with oxygen.1, but for me it works correctly.
Could you provide us an example?
For example, zip a workspace with a single php projet and single php file that I could test?

Thank you!

Thierry.

PS: did you try with oxygen.1 and just PDT installed? Maybe there are some problematic plugins...
Comment 2 Samuel Sol CLA 2017-12-14 12:43:48 EST
Greetings Thierry, I think I managed to narrow the case where it happens. You are right that it is not in every case, but as far as I can tell it happens consistently when using an user library and the method is on the grandparent (or on a trait used by the parent).

For example:


User Library
============
Let's  say that you created a User Library based on a local directory. On this library you have the two classes below:

abstract class Parent extends GrandParent 
{
   /**
    * DOC for the parent method
    */
   public function parentMethod()
   {
   }
}



abstract class GrandParent
{
   /**
    * DOC for the GrandParent method
    */
   public function grandParentMethod()
   {
   }
}


Project
=======
You add the user library to your project include path and create the following class:

class Child extends Parent
{

   public function parentMethod()
   {
   }

   public function grandParentMethod()
   {
   }
}


Testing
=======
Create a PHPDoc on each method, by typing : "    /**[ENTER]   " before each method:


Expected Results
================

class Child extends Parent
{

   /** 
    * {@inheritDoc}
    * @see Parent::parentMethod()
    */
   public function parentMethod()
   {
   }

   /** 
    * {@inheritDoc}
    * @see GranParent::grandParentMethod()
    */
   public function grandParentMethod()
   {
   }
}


Actual Results
==============

class Child extends Parent
{

   /** 
    * {@inheritDoc}
    * @see Parent::parentMethod()
    */
   public function parentMethod()
   {
   }

   /** 

    */
   public function grandParentMethod()
   {
   }
}


Comments
========
The same behavior happens if you have a trait used by the Parent class and you override the method on the child. I will see if I can make an workspace like this. Mine has the work library which I can't share.
Comment 3 Thierry BLIND CLA 2017-12-15 08:35:20 EST
Hi Samuel,,
sorry, I really can't reproduce the problem :/
Maybe you should give me even more precise steps to reproduce the bug, for now I'm a bit lost...

Thierry.

PS: I think a "demo" workspace would finally be the best in this case :)
Comment 4 Samuel Sol CLA 2017-12-19 09:36:53 EST
Greetings Mate,

I will try to create a clean one and add it here. I think until Friday I can do it.