Bug 473660 - Unknown class objects' methods calls gets into call hierarchy
Summary: Unknown class objects' methods calls gets into call hierarchy
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: 2015-07-27 10:27 EDT by Alexander Ustimenko CLA
Modified: 2020-05-14 10:17 EDT (History)
1 user (show)

See Also:


Attachments
Example file with class with method and anon type object (98 bytes, application/x-php)
2015-07-27 10:27 EDT, Alexander Ustimenko CLA
no flags Details
Screenshot for quick understand (139.28 KB, image/png)
2015-07-27 10:28 EDT, Alexander Ustimenko CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ustimenko CLA 2015-07-27 10:27:26 EDT
Created attachment 255455 [details]
Example file with class with method and anon type object

Prerequirements:

* Create class with method.
* Create object with unknown type.
* Call on this object method, created in class.
* Go into class with method and activate "Call Hierarchy"

AS IS:

* System show you call from file with unknown type object.

SHOULD BE:

* System show you nothing.

URLS:

* http://gyazo.com/4ffa37ae37e88eb8fb046efbd2f32f96 - Screenshot
Comment 1 Alexander Ustimenko CLA 2015-07-27 10:28:51 EDT
Created attachment 255456 [details]
Screenshot for quick understand
Comment 2 Dawid Pakula CLA 2015-07-28 09:16:02 EDT
It's correct behavior for me. If PDT isn't able to detect object type, fallback to filter by name.

As an enhancement we may introduce "strict" mode, to filter such positions.
Comment 3 Alexander Ustimenko CLA 2015-07-28 09:42:11 EDT
Hi Dawid,

Tnx for the quick answer.

I dont' think it should be a default, until we are at some javascript-like weak-typed lang. In PHP it should be ok to determine by default class name or @phpdoc mechanism.

In my concrete case I have a class with method "send" and in it's call hierarchy I see a tons of non-related "send" calls. I dont' think that in OOP-lang we should stay in "unknown" types calls side.

My colleague test same case in phpstorm (I dont' like  it anyway for base unusability) and it gets us calls only when we mark class intentionally. It dont' give us calls of anons.

So if you think it could be added as an option, I vote for "Strict" mode to be default and enable "Week mode" by standalone option.