Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm Squawks on @return void for __construct()

I'm using PHPStorm and trying to figure out how to make it stop squawking when a __construct() has @return void in its PHPDocs...

According the PHPDocs, void is valid, or the @return may be omitted. That being said, is there a way to fix this or is it a bug?

like image 392
user1960364 Avatar asked Nov 11 '14 11:11

user1960364


1 Answers

Unfortunately you can not turn off just this one very specific inspection. The whole PHPDoc method signature inspection would need to be turned off. Fortunately you can set the scope of the inspection to be only your own project code, ignoring 3rd party libraries and frameworks. See the scopes dropdown on the right under the description.

PHPStorm Inspections Screenshot

Also on a case-by-case basis you can turn off the inspection above each PHPDoc comment:

/** @noinspection PhpDocSignatureInspection */
/**
 * @return void
 */
public function __construct() ...
like image 135
Matt S Avatar answered Sep 21 '22 12:09

Matt S