How to mark that an argument is optional in PHPDoc?

ForYou

New Member
I've got this constructor that takes an optional argument. The main problem with this is usability. The developer using my framework will catch a headache instantly because he doesn't know if he can provide an argument, what kind of argument, or if he can't at all. Conclusion: It just sucks. But PHPDoc may help a little bit if someone has a reasonable IDE like Netbeans installed ;)So:\[code\]class ChildClass extends ParentClass { public function __construct() { $tplFile = func_get_arg(0); if (!isset($tpl)) { $tpl = 'index'; } parent::__construct($tpl); }}\[/code\]How could I use PHPDoc here to indicate that there can be provided an optional [$tpl] argument?
 
Back
Top