Skip to content

Use property comment as desccription #35

@kk738

Description

@kk738

Is there a possibility to use the description of a property that's already set for the getter as well?

What I want to do is:

/**
 * User the network environment is assigned to
 *
 * @var User $user
 */
protected $user;

to become:

/**
* Get the user the network environment is assigned to
*
* @return  User
*/
public function getUser() : User
{
return $this->user;
}

I think about a template getter.js file like:

// prettier-ignore
module.exports = (property) => `
	/**
         *
	 * Get the ${property.getterExistingDescription()}
	 *
	 * @return  ${property.getType() ? property.getType() : "mixed"}
	 */
	public function ${property.getterName()}() : ${property.getType() ? property.getType() : "mixed"}
	{
		return $this->${property.getName()};
	}
`;

Is this already possible with a template, did I overlook something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions