Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use property comment as desccription #35

Open
kk738 opened this issue Jan 16, 2024 · 0 comments
Open

Use property comment as desccription #35

kk738 opened this issue Jan 16, 2024 · 0 comments

Comments

@kk738
Copy link

kk738 commented Jan 16, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant