This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268130 - Editor marked unused a method what is called from array_map
Summary: Editor marked unused a method what is called from array_map
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-21 09:45 UTC by lolka_bolka
Modified: 2016-09-21 11:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot about problem (10.45 KB, image/jpeg)
2016-09-21 09:45 UTC, lolka_bolka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lolka_bolka 2016-09-21 09:45:42 UTC
Created attachment 162151 [details]
Screenshot about problem

I know, it could be hard to parse this, but I think this is a legal issue.

When you are calling a method in regular way, like $this->doSomething(); the everything is fine, Netbeanse recoginez that I am using that method.

But when I call it like this array_map([$this, 'doSomething'], ...); it is not.

It is true also for array_walk, and call_user_func.

Is it possible to fix it?
Comment 1 Tomas Mysik 2016-09-21 10:53:31 UTC
Definitely not a P2 so lowering.

Thanks for reporting.
Comment 2 lolka_bolka 2016-09-21 10:57:02 UTC
(In reply to Tomas Mysik from comment #1)
> Definitely not a P2 so lowering.
> 
> Thanks for reporting.

Oh, sorry, I thought lower numbers are lower priority. Now I know this.

My idea is check where the parameter has the callback, check is it an array or a string, if string, check, is there a `::` in it, then that is a static method, if it is an array, then 2nd item is the method.

I forgot array_filter, I don't know is there any more php function what uses callback.
Comment 3 Tomas Mysik 2016-09-21 11:07:23 UTC
(In reply to lolka_bolka from comment #2)
> Oh, sorry, I thought lower numbers are lower priority. Now I know this.

No problem, of course :)

Thanks.