ahiijny
ahiijny

Reputation: 353

Is it possible to write PHPDoc documentation for @param without specifying the type?

I'm using PhpStorm. When I put the following PHPDoc documentation for a function:

/**
 * @param $id application identifier
 */
public function foo($id)

And I run the "Quick documentation" (Ctrl + Q) command for the function in PHPStorm, it shows this:

Parameters: App\Models\Application $id identifier

It looks like for some reason, the IDE is interpreting the first word of the parameter description, application, as the type for the parameter. I don't want to specify the type of the parameter (I don't know what it is), I just want to add a brief description about the parameter in the documentation. What should I do?

Upvotes: 0

Views: 68

Answers (1)

Don't Panic
Don't Panic

Reputation: 41820

If you don't know what it is, you can use mixed. The type goes before the $id and the part after $id will be used as the description.

/**
 * @param mixed $id application identifier
 */
public function foo($id)

Upvotes: 1

Related Questions