You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commenting a method with @return void triggers an InvalidReturnVoid error: Function return type is void, but function contains return statement (....Commenting.FunctionComment.InvalidReturnVoid)
when the method contains anonymous class that contains a return.
Example:
<?php
namespace Test;
/**
* Class AnonTest
*/
class AnonTest
{
/**
* do something
*
* @return void
*/
public function someFunc(): void
{
$class = new class
{
/**
* Getter
*
* @return string
*/
public function getString(): string
{
return 'some string';
}
};
echo $class->getString();
}
}
The text was updated successfully, but these errors were encountered:
pavloivanov
changed the title
Commenting.FunctionComment.InvalidReturnVoid conditional issue with anon classes
Commenting.FunctionComment.InvalidReturnVoid conditional issue with anonymous classes
Jan 17, 2017
Commenting a method with
@return void
triggers anInvalidReturnVoid
error:Function return type is void, but function contains return statement (....Commenting.FunctionComment.InvalidReturnVoid)
when the method contains anonymous class that contains a return.
Example:
The text was updated successfully, but these errors were encountered: