Skip to content

Conversation

@parijke
Copy link

@parijke parijke commented Nov 28, 2025

This PR removed the dead code from magic methods.

@parijke parijke changed the title feature: add handling for void magic methods feature: remove @return from void magic methods Nov 28, 2025
@parijke parijke changed the title feature: remove @return from void magic methods feature: remove @return void from magic methods Nov 28, 2025
@samsonasik
Copy link
Member

The rule purpose is only remove @return tag when there is native return type.

For removing @return tag when there is no native type, that should be in separate rule so the functionality is isolated, and easy to exclude/skip when needed.

@parijke
Copy link
Author

parijke commented Nov 28, 2025

Can you help me a little then where / how it should be done? This is my forst contributing attempt

@parijke
Copy link
Author

parijke commented Nov 29, 2025

Can you help me a little then where / how it should be done? This is my forst contributing attempt

@samsonasik @TomasVotruba

@samsonasik
Copy link
Member

Add another rule under rules/DeadCode/Rector/ClasaMethod, add test under rules-tests/DeadCode/Rector/ClassMethod as well

@TomasVotruba
Copy link
Member

@parijke Any update on this? I'd like to merge and ship it

@parijke
Copy link
Author

parijke commented Dec 24, 2025

I'll be back Saturday from the holidays. I will do it in the upcoming week

@parijke
Copy link
Author

parijke commented Dec 26, 2025

Add another rule under rules/DeadCode/Rector/ClasaMethod, add test under rules-tests/DeadCode/Rector/ClassMethod as well

I think it should be in the Deadcode/PhpDoc namespace anyway?

@samsonasik
Copy link
Member

No need, just new rule under DeadCode\Recror\ClassMethod is fine imo :)

@parijke parijke marked this pull request as draft December 26, 2025 09:52
@parijke parijke force-pushed the feature/remove-void-from-magic-methods-as-return branch from 29d7ee1 to 010b7b5 Compare December 26, 2025 09:52
@parijke parijke force-pushed the feature/remove-void-from-magic-methods-as-return branch from 010b7b5 to 4b9d483 Compare December 26, 2025 09:54
@@ -0,0 +1,16 @@
<?php

namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector\Fixture;
Copy link
Member

Choose a reason for hiding this comment

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

move the fixture under new namespace directory RemoveUselessVoidReturnFromDocblockVoidMagicMethodsRector

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.

3 participants