Quick one; Netbeans 7.0 for PHP development:
Is there any way to inform NetBeans when class_alias has been used to alias a class, thereby triggering code-completion for the alias?
class Foo{
public static $hello = 'world';
}
class_alias('Foo', 'Bar');
Bar::$h // triggers code completion for $hello
^
I’m still working towards becoming adept with NetBeans, and haven’t really played to much with the config, so I’m hoping there’s some sort of project specific config I can modify.
Thanks in advance folks.
Interestingly, I can can’tSee below instead use namespacing’s use (though my project is otherwise namespace free) to achieve what NetBeans will understand:
class Foo{
public static $hello = 'world';
}
use \Foo as Bar;
Bar::$h // DOES trigger code completion for $hello
^
I don’t know if this is a viable solution though. My Loader class also holds a map of alias => classname and when a given class is auto-loaded, the load method searches the map and aliases if necessary.
This wouldn’t work as hoped, as use is completely unsuited to any sort of dynamic aliasing:
- Can’t be used in any scope other than global,
usein a function or method issues a parse error. usehas no support for dynamic naming;use \{$class} as {$alias};is illegal.- Most importantly,
usedoesn’t carry through file inclusions, thereby rendering it’s usage … well, useless. Pun-tastic.
No, sorry, I don’t think there is.
I have to say
class_aliasis a new one on me!