Skip to content

Conversation

@arshidkv12
Copy link
Contributor

No description provided.

@samsonasik samsonasik marked this pull request as draft September 8, 2025 12:27
@samsonasik
Copy link
Member

I guess we need to discuss first when it actually needed, eg:

  • it should only on non-final class, yes, you read it right, to enforce child to not override it, see https://3v4l.org/lKhiI/rfc#vgit.master
  • if class already final, just skip
  • etc (please provide other use case you can think off ) :)

@arshidkv12
Copy link
Contributor Author

It needs Class_::class, right ?

public function getNodeTypes(): array
{
    return [Class_::class];
}

@samsonasik
Copy link
Member

Yes

@arshidkv12 arshidkv12 marked this pull request as ready for review September 8, 2025 14:08
@samsonasik
Copy link
Member

samsonasik commented Sep 8, 2025

Looking at the change, it seems you're trying to change @final to native final param. I can see the reason, but this may need more discussion if it is actually needed in real project.

@arshidkv12
Copy link
Contributor Author

Thanks for the feedback. I understand your concern. I thought converting @Final to the native final keyword would help modernize code, but I agree it might need more input from community about real-world use cases.

Copy link
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

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

It seems you copy paste logic from other rules, please remove the unnecessary unrelated logic, focus only on this rule purpose, and also no need separate service for only used once logic.

@arshidkv12
Copy link
Contributor Author

It seems you copy paste logic from other rules, please remove the unnecessary unrelated logic, focus only on this rule purpose, and also no need separate service for only used once logic.

Ok.

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
@arshidkv12
Copy link
Contributor Author

Please check it

@samsonasik
Copy link
Member

as I tell before, let it sit here for a while, this may need more discussion if it is actually needed in real project.

@TomasVotruba
Copy link
Member

I'm thinking about this rule again, it doesn't seem to be good enough in Rector core.
Using @final is done on purpose, usually to comply with static analysis, while allowing internal reflection of mocking or proxies. So converting this to strict final is agains the logic.

This is a great candidate for local custom rule though 👍

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