There was an error while loading. Please reload this page.
Hi,
I'm using PHPCS to check Javascript files, with the Squiz standard. I don't know yet if a better Javascript standard exists for PHPCS ?
Well, here's the issue. It's a working example.
SomeClass.prototype.switch = function() { // do something };
I know I shouldn't use such keywords to name a function, but since it's not a switch statement, PHPCS shouldn't have thrown an error for this ?
The sniff is "Inline control structures are not allowed" (Generic.ControlStructures.InlineControlStructure.NotAllowed) but it simply checks for control structure tokens. That's why I think the issue is deeper than this particular sniff. Maybe an issue with the tokens detection ?
I could simply disable this sniff, but I would prefer avoid it. Thanks for your help.