You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
Hi,
In Java Styles enumeration implementations, members are called with static methods that are not explicitly declared. So, in IDE like Eclipse PHP or other, those methods are not listed for auto-completion.
I found that adding appropriate PHPDocumentor doc blocks resolves this issue.
For example, if you have those members in a Exemple class extending AbstractMultiton:
Exemple::FOO()
Exemple::BAR()
You can add this doc block:
/**
* @method static Exemple FOO()
* @method static Exemple BAR()
*/
class Exemple extends AbstractMultiton
{
(...)
}
Trust me, it is very useful !
The text was updated successfully, but these errors were encountered:
This is entirely unnecessary. If you do not like those semantics use Enumeration::memberByKey() instead. Static analysis will work in your editor with this calling convention.
I agree, this is not necessary, but it is more convenient, at least for me.
Exemple::FOO() is shorter than Exemple::memberByKey(Exemple::FOO) or Exemple::memberByKey('FOO') and auto-completion in IDE is called once instead of two.
Without those @method annotations, auto-completion only propose the static member of the enumeration (FOO) so we always need to add parentheses at the end to call the Enumeration object (FOO()). But the IDE doesn't recognize the static method Exemple::FOO() because it is not explicitly declared.
Anyway, it is up to you to add this tip. I just wanted to share it. You can close the issue if you mind.
Hi,
In Java Styles enumeration implementations, members are called with static methods that are not explicitly declared. So, in IDE like Eclipse PHP or other, those methods are not listed for auto-completion.
I found that adding appropriate PHPDocumentor doc blocks resolves this issue.
For example, if you have those members in a Exemple class extending AbstractMultiton:
You can add this doc block:
Trust me, it is very useful !
The text was updated successfully, but these errors were encountered: