DontReturnFromCloneLinter
lexidor opened this issue · comments
Lexidor Digital commented
For rationale, see facebook/hhvm#3757.
Returning a value from __clone()
is always a mistake, since the return value is never used. __clone is called on the newly created object before resolving a clone $obj
expression.
Checking the return type of the method ought to be enough. No need to actually check the body for returns.