Automatically generated getters and setters PHPDoc
Hi guys!
I've set custom setter template to make it return $this for non-static classes. Template looks like this:
/**
* @param ${TYPE_HINT} $${PARAM_NAME}
#if (${STATIC} != "static")
* @return ${CLASS_NAME}
#end
*/
public ${STATIC} function set${NAME}($${PARAM_NAME})
{
#if (${STATIC} == "static")
self::$${FIELD_NAME} = $${PARAM_NAME};
#else
$this->${FIELD_NAME} = $${PARAM_NAME};
return $this;
#end
}
But when I trying to generate setters - I'm getting correctly-generated setter but without PHPDoc. Steps:
1:

2:

Do I need to enable something in the settings to make PHPStorm to add PHPDoc?
Please sign in to leave a comment.
Hi Dima,
It will work fine if you define type of field with PHPDoc @var:
Thanks Andriy!