I'm a little confused as to which JSDoc describes a constructor function for a class, and if PHPStorm understands either.
When I research which JSDoc to use I keep coming across two versions. There is @constructs
and @constructor
.
Here are some references.
https://code.google.com/p/jsdoc-toolkit/wiki/TagConstructor
https://code.google.com/p/jsdoc-toolkit/wiki/TagConstructs
Now I understand that @constructs
should be used with @lends
but why?
if you need to mark a function as a constructor, @constructor is the right choice. @constructs only applies to a lent function and may be used with @lends tag only (that can only appear on object literals). See this Wiki page for more info on @lends tag. Note that PHPStorm supports both tags for type hinting/navigation