Current Situation
The Internal. reference prefix is solely intended for internal use, i.e. for error codes coming from PHPCS itself about the processing of a file, such as Internal.NoCodeFound.
However, while writing tests for the Ruleset class, I discovered, it is currently possible to name a standard Internal and have sniffs included from it.
Aside from this being confusing for end-users, the fact that this is (incidentally ?) supported may not be taken into account in all relevant places and I wouldn't be surprised if there are bugs to content with if a standard would be called Internal.
Proposal
- Soft deprecate support for a standard being called
Internal in the next 3.x minor.
- Hard deprecate support for a standard being called
Internal in what is expected to be the last 3.x minor.
- Remove support for including a standard called
Internal in 4.0.0.
In practice, removing support will mean that if an Internal standard is requested via --standard=Internal or by including such a standard from within a ruleset via <rule ref="Internal"/>, the standard will no longer be read out and the sniffs no longer included. The end-user will be presented with a warning letting them know the standard is being disregarded.
If the Internal standard was the only referenced standard, the user will also be presented with a "No sniffs were registered" error.
Terminology used
Soft deprecation: deprecation via changelog mention and/or announcement only.
Hard deprecation: a deprecation notice will be shown at runtime, but will not affect the exit code of PHPCS.
Impact
It is not expected that there are any external standards in existence which are called Internal, so the impact is expected to be nill.
Code searches of public code executed to confirm this:
Related issues
Loosely related to #689
Opinions ?
/cc @asispts @dingo-d @fredden @GaryJones @greg0ire @kukulich @michalbundyra @Ocramius @sirbrillig @stronk7 @weierophinney @wimg
Current Situation
The
Internal.reference prefix is solely intended for internal use, i.e. for error codes coming from PHPCS itself about the processing of a file, such asInternal.NoCodeFound.However, while writing tests for the
Rulesetclass, I discovered, it is currently possible to name a standardInternaland have sniffs included from it.Aside from this being confusing for end-users, the fact that this is (incidentally ?) supported may not be taken into account in all relevant places and I wouldn't be surprised if there are bugs to content with if a standard would be called
Internal.Proposal
Internalin the next 3.x minor.Internalin what is expected to be the last 3.x minor.Internalin 4.0.0.In practice, removing support will mean that if an
Internalstandard is requested via--standard=Internalor by including such a standard from within a ruleset via<rule ref="Internal"/>, the standard will no longer be read out and the sniffs no longer included. The end-user will be presented with a warning letting them know the standard is being disregarded.If the
Internalstandard was the only referenced standard, the user will also be presented with a "No sniffs were registered" error.Terminology used
Soft deprecation: deprecation via changelog mention and/or announcement only.
Hard deprecation: a deprecation notice will be shown at runtime, but will not affect the exit code of PHPCS.
Impact
It is not expected that there are any external standards in existence which are called
Internal, so the impact is expected to be nill.Code searches of public code executed to confirm this:
Related issues
Loosely related to #689
Opinions ?
/cc @asispts @dingo-d @fredden @GaryJones @greg0ire @kukulich @michalbundyra @Ocramius @sirbrillig @stronk7 @weierophinney @wimg