Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

DontReturnFromCloneLinter #546

Open
lexidor opened this issue Jun 14, 2023 · 0 comments
Open

DontReturnFromCloneLinter #546

lexidor opened this issue Jun 14, 2023 · 0 comments

Comments

@lexidor
Copy link
Contributor

lexidor commented Jun 14, 2023

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.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant