PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
Fix `Squiz.Commenting.FunctionComment.InvalidNoReturn` false positive when return type is `never`
The Squiz.Commenting.FunctionComment.InvalidNoReturn causes false positives when it encounters the never return type.
Tested this locally with:
<rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn"/>
/**
* @return never
*/
private function foo()
{
throw new \RuntimeException('This method never returns');
}