some_guy
some_guy

Reputation: 390

How to use different/multiple @param

I have a method in a helper class to do some repetitive tasks. I have to pass to it different classes.

Something like

@param Entity $entity || Entity2 $entity etc..

I tried it like this but it sees only first of classes. Others, above in use statment section are unused?

How to do that?

Upvotes: 0

Views: 34

Answers (1)

Tony DeStefano
Tony DeStefano

Reputation: 829

You can use a pipe in the docblock like this:

/**
 * @param Entity|Entity2 $entity
 */

Upvotes: 1

Related Questions