Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing return statement in PhpStorm

Tags:

php

phpstorm

I fall in a strange problem of PhpStorm. I'm using the trial version of 2016.1, I've this method inside my own class:

/**
 * Set arbitrary log
 * @param $level string level of the error message
 * @param $mex string The message
 * @param $ctx array context of the problem
 */

public function log($level, $mex, array $ctx = array())
{
    $mex = $this->Message($level, $mex, $ctx);
    $this->write($mex);
}

Now PhpStorm underlined in green all the php doc with this message:

Missing @return tag in function/method PHPDOC comment

but I missing the @return 'cause I don't need it in this function. I only need to store the information passed as parameter inside another method.

Is a PhpStorm bug or I did wrong something?

like image 373
Sandokan Avatar asked Oct 29 '25 09:10

Sandokan


1 Answers

For the sake of documentation, you could you use:

@return void
like image 158
Wayne Whitty Avatar answered Oct 30 '25 21:10

Wayne Whitty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!