0

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?

1
  • 1
    Use mixed type (or some other generic) then. PHPDoc requires type. In your case, IDE treats it as PHPDoc-like syntax where type goes after the name. Commented Apr 4, 2019 at 18:37

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.