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.
Our CI system checks contrib modules using PHP lint. In src/Controller/GeshiFilterConflicts, it complains about the redundant usage of GeshiFilterConflicts within the use directive and as class name (last seen using PHP 7.1.3). This breaks our builds.
Suggested fix: Remove the use directive and use the full namespace. (This should not be a problem, as it occurs once only within the file.)
Comment | File | Size | Author |
---|---|---|---|
#14 | 2866206-remove-geshifilterconflicts-from-install.patch | 2.13 KB | Mario Steinitz |
| |||
#10 | 2866206-remove-use-for-removed-class.patch | 376 bytes | Mario Steinitz |
#2 | 2866206-namespace-lint-error.patch | 726 bytes | Mario Steinitz |
|
Comments
Comment #2
Mario SteinitzComment #3
Mario SteinitzComment #4
Mario SteinitzComment #5
yukare CreditAttribution: yukare commentedI do not remember if this is not a coding standart in drupal, so let see what the testbot says.
It is: https://www.drupal.org/docs/develop/coding-standards/namespaces
Comment #6
Mario SteinitzOk, then I suggest renaming the helper class e.g. to GeshiFilterConflictsBase. Or just using an alias with the use directive.
It's small changes. So I leave it to you. But having your module excluded from PHP lint or patching it ourself after each composer install/update is not really a nice option.
Comment #7
yukare CreditAttribution: yukare commentedThe class just add a function, i will put the function in the same class as form.
Comment #9
yukare CreditAttribution: yukare commentedI removed the class, and put the function inside the form. All this code is not used anyway, it is from a part from drupal 7 that is not ported to drupal 8, there is a issue for it.
Please test it now, it will pass.
Comment #10
Mario SteinitzThanks for your efforts. Yet the USE directive in src/Controller/GeshiFilterConflicts.php, Line 5, is still there. This is the one causing lint to break.
Could you please remove that one as well? - For your convenience, I attached an according patch.
Comment #11
Mario SteinitzComment #13
yukare CreditAttribution: yukare commentedI just forgot this change in the previous commit.
Comment #14
Mario SteinitzSorry to bother again. While PHP lint is happy now, our changes caused another runtime issue:
I traced it to geshifilter.install, which still tried to use the removed class. As I'm not quite sure about the progress with the pending conflicts issue 2354511, I just commented the according lines and made the helper method listConflicts() static.
Find the suggested patch attached.
Comment #15
Mario SteinitzComment #16
yukare CreditAttribution: yukare commentedSince it is not used, there are not tests for it. Lets see if it pass now before commit.
Comment #18
Mario SteinitzWe're using the dev version including the above patch on a current project, which is under heavy testing right now. After having commented the parts within the .install file, we did not experience any further issues due to lint and/or GeshiFilterConflicts.
Comment #20
yukare CreditAttribution: yukare commentedCommited, please reopen if something is still missing.
Comment #21
Mario SteinitzThanks again you for your efforts. It's all working now.