We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_object_vars
Rector removes seemingly unused properties, but which are used by get_object_vars.
class Foo implements \JsonSerializable { public function __construct(private readonly string $foo) { } public function jsonSerialize(): array { return get_object_vars($this); } }
Rector should not remove property $foo here.
$foo
I would think that whenever there is a get_object_vars($this) in a class, rector should not remove any non-static properties or see them as used.
get_object_vars($this)
The text was updated successfully, but these errors were encountered:
Reproduced at https://getrector.com/demo/65df94bf-d85e-4387-ae17-a70930158dc4
with proof different result https://3v4l.org/f1JNG vs https://3v4l.org/JolHc
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug Report
Rector removes seemingly unused properties, but which are used by
get_object_vars
.Minimal PHP Code Causing Issue
Expected Behaviour
Rector should not remove property
$foo
here.I would think that whenever there is a
get_object_vars($this)
in a class, rector should not remove any non-static properties or see them as used.The text was updated successfully, but these errors were encountered: