Skip to content
New issue

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

[DeadCode] Add RemoveJustPropertyFetchRector #2433

Merged
merged 5 commits into from
Jun 4, 2022

Conversation

TomasVotruba
Copy link
Member

No description provided.

@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch 7 times, most recently from d0612de to 14eaec3 Compare June 4, 2022 14:57
// ...
$assign = $stmt->expr;

if (! $assign->expr instanceof PropertyFetch) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about static property fetch ?

Copy link
Member Author

@TomasVotruba TomasVotruba Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of static property fetch, some reading/writing/cache is expected, so it would be risky to try to cover it.

This rule covers only readonly property fetch assign.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, seems like --debug/-vvv option does not work anymore. Only the last error message is printed, not the full stack trace. I tired to downgrade to Symfony 6 but it was not helpful :/

Could you check it? 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try. How to reproduce the not shown stack trace for your use case? throw Exception?

Copy link
Member Author

@TomasVotruba TomasVotruba Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I just throw a ShouldNotHappenException to e.g. PhpDocInfoFactory::createFromNodeOrEmpty() on first line.

@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch 2 times, most recently from 3070454 to bb5cf4b Compare June 4, 2022 15:46
@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch from bb5cf4b to 5498164 Compare June 4, 2022 16:45
@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch 5 times, most recently from eb7be57 to 84cc85a Compare June 4, 2022 17:14
@TomasVotruba TomasVotruba enabled auto-merge (squash) June 4, 2022 17:14
@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch from 84cc85a to fddd92e Compare June 4, 2022 17:18
@TomasVotruba TomasVotruba force-pushed the tv-remove-just-assign branch from fddd92e to ca8e4a7 Compare June 4, 2022 17:25
@TomasVotruba TomasVotruba merged commit b0a6173 into main Jun 4, 2022
@TomasVotruba TomasVotruba deleted the tv-remove-just-assign branch June 4, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants