Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Unfortunately, we have a major Drupal 6 site and not enough time to upgrade to Drupal 7.
How would you recommend that we deal with "Implementation of..."?
- Simply ignore the warning-level message (it's only a warning afterall)
- Create a new rule and disable the old one through configuration (duplicate the ruleset.xml file perhaps)
- Implement an option in the package that specifies which version of Drupal is being scanned (could be useful for other things)
I'd also say that we're not really strict about forcing people to use "Implementation of..." in Drupal 6 as people sometimes (probably most often) just use "Implements...". However, I'd rather not warn people about the use of "Implementation of..." when it's perfectly valid in Drupal 6. This is why I hesitated and wanted to ask your opinion.
Comment | File | Size | Author |
---|---|---|---|
#5 | coder-phpcs-implementation-of-2220833.patch | 3.84 KB | psynaptic |
Comments
Comment #1
psynaptic CreditAttribution: psynaptic commentedComment #2
klausiYou could just "hack" the ruleset.xml like this to disable the hook sniff:
Maybe that could also be specified as command line parameter to phpcs.
Comment #3
psynaptic CreditAttribution: psynaptic commentedThinking more on this, the problem with that seems to be that we won't get the useful warnings about erroneous hook implementation documentation. We don't care so much if people use "Implements..." vs "Implementation of..." but we do require one or the other to be present and in the correct format.
Comment #4
psynaptic CreditAttribution: psynaptic commentedDo sniffs have access to the ruleset config? Perhaps I could add an option to allow both versions.
Comment #5
psynaptic CreditAttribution: psynaptic commentedI've added an option which can be used in
ruleset.xml
as follows:By default the existing behavior is maintained but there is now the option to allow "Implements" and "Implementation of" to pass without generating a warning.
Comment #6
klausiSince you can also disable individual sniffs with a phpcs.xml file in your project like Drupal 8 core does I think this is not necessary anymore.