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

QA: make all classes final #376

Merged
merged 2 commits into from
Oct 18, 2022
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 18, 2022

QA: make all classes final

The "class vs sniff name" matcher in the PHPCS autoloader does not handle sniffs classes extending other sniffs well.

Now, while this "standard" doesn't actually contain any sniffs, the utilities in this library are not intended to be extended anyway, aside from the explicitly abstract base sniffs.

So, with that in mind, I'm making all classes in this library final, with the exception of some select test classes (the BCFile ones as those need to be extended to safeguard that the PHPCSUtils native functionality mirrors the PHPCS native functionality).

If anyone has issues with any particular class now being final, please report this ASAP and please include a good use-case of why that particular class should not be final.

QA: don't use static for LSB in final class

... as there can never be a (grand-)child class.

The "class vs sniff name" matcher in the PHPCS autoloader does not handle sniffs classes extending other sniffs well.

Now, while this "standard" doesn't actually contain any sniffs, the utilities in this library are not intended to be extended anyway, aside from the explicitly `abstract` base sniffs.

So, with that in mind, I'm making all classes in this library `final`, with the exception of some select test classes (the `BCFile` ones as those need to be extended to safeguard that the PHPCSUtils native functionality mirrors the PHPCS native functionality).

If anyone has issues with any particular class now being `final`, please report this ASAP and please include a good use-case of why that particular class should not be `final`.
... as there can never be a (grand-)child class.
@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Oct 18, 2022
@jrfnl jrfnl merged commit be2cdce into develop Oct 18, 2022
@jrfnl jrfnl deleted the feature/qa-make-all-classes-final branch October 18, 2022 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant