Gareth Pursehouse
Gareth Pursehouse

Reputation: 67

PHPDoc to assign @param as a referened @property

I'm trying to define a param for a method as being the ID field from another class. Basically this idea...

/**
 * @param \Database\Member::id $memberId
 * @return MemberEntity
 */
public function getMember( int $memberId ) : MemberEntity
{
...
}

the @see command doesn't seem to be the right solution for this. Is there something I'm missing here? The PHPDoc website is surprisingly minimal...

thanks!

Upvotes: 1

Views: 305

Answers (1)

Marcel Bezerra
Marcel Bezerra

Reputation: 179

The @param tag receives the values: type, name and description. Apparently the type of your variable is int. If the \Database\Member::id attribute is not a native type of php or a class, it can not be used that way. So it is not possible to do this type of reference you want in traditional PHPDoc.

Syntax @param [Type] [name] [<description>]

Upvotes: 1

Related Questions