I have the following code:
/**
* @param TranscodingJob $transcodingJob
*
* @return TranscodingJob
* @throws \Lexik\Bundle\WorkflowBundle\Exception\WorkflowException
*/
public function onTranscodingJobError(TranscodingJob $transcodingJob) { ...
... and I find that when I hover over the annotation, this note appears:
phpcs: Missing parameter comment
How can I modify my annotations to make the complaint go away?
(I have tried simply adding text above the annotation for the parameter, and that doesn't seem to fix it.)
PHPCS is a command-line utility which can output varying levels of detail and evaluate one file, a whole directory, or a pattern match of target files. Its output is a list of flaws found, with an error message and line number supplied. By default PHPCS comes pre-installed with a number of coding standard definitions.
Then run PHP_CodeSniffer like this: phpcs --standard=/path/to/mystandard.xml /path/to/code Having your own ruleset lets you do a lot of things, including changing error messages, changing the severity or type of a message, including checks from other standards, and setting global ignore rules.
There are two main ways of installing PHPCS: directly, or via PEAR. Using the PEAR repositories is recommended and adapts to all the various platforms. It's also probably very familiar to all PHP developers!
A file doc comment is placed at the top of the file, above any include statements and contains pretty much the same information as the class doc comment. When added to your application your document structure might look like this.
You need to add comment for your @param variable
Change your code as
/**
* @param TranscodingJob $transcodingJob comment about this variable
*
* @return TranscodingJob
* @throws \Lexik\Bundle\WorkflowBundle\Exception\WorkflowException
*/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With