Closed (fixed)
Project:
Coder
Version:
8.x-3.x-dev
Component:
Coder Sniffer
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2020 at 10:03 UTC
Updated:
27 Nov 2020 at 09:10 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
jonathan1055 commentedHi joevagyok,
I can't replicate this, using your graphic as an example. Can you prvide a short text file with the actual problem, and also show here the actual warning you get. Use flag
-sto show the full sniff name in the report.Comment #3
joevagyok commentedHi, @jonathan1055,
I have attached a php test file as txt that produced the following error for us:
Comment #4
jonathan1055 commentedThanks @joevagyok, yes this test does produce the warning, but it was not the example you gave in the issue summary (which does not fail).
Anyway, yes it seems there could be a issue here - your line is reported as too long because overall it does exceed the limit, however the array portion of the line stops before the 80 char position.
Comment #5
jonathan1055 commentedI have created https://github.com/pfrenssen/coder/pull/119 to work on the correction
Comment #7
arkener commentedThanks for working on this @jonathan1055 and thank you @joevagyok for reporting this issue and providing the test code. This change has now been merged.
Comment #8
jonathan1055 commentedThanks for the commit Arkener.
Comment #10
ayalon commented@jonathan1055: Thanks for the fix. Can you push a new version to drupal.org. On a large code base tons of files are affected due to this bug.
Comment #11
jonathan1055 commentedHi ayalon,
I can't push the version, I only fixed the code. @Arkener or @Klausi will have to do that. Version 8.3.10 was released 5 September, only just over one month ago, but I don't know the timescale for the next tagged release.
If you are running locally you can always use the -dev version of Coder. Or you can temporarily ignore this sniff by the adding the following to your phpcs.xml ruleset file:
Hope that helps.
Comment #12
klausiCoder 8.3.11 has been released with this fix!
Comment #13
jonathan1055 commentedChanging title to better reflect the solution. The original title "Line character limit is incorrectly checked when arrays are present" is repeated here in this comment to allow for searching.