This is a simple fix for the following situation:
This is a simple fix for the following situation:

My sniffs use 5.3 namespaces.

So when I use my coding standard, it gets registered, but PHP_CodeSniffer assumes underscores where I use a namespace.

Hence, my run fails with "Cannot redeclare class 'Vendor\Sniffs\Something\FooSniff'" later.

So the fix I introduced seems simple - without going reflection-crazy, I create a second variable which will do Vendor\Sniffs\Something\FooSniff along with the current default of Vendor_Sniffs_Something_FooSniff.

Then I test if the 5.3 variation was found (without triggering autoload) - if so, I override the name ($className) which is used to internally register it my Sniff.

Then all is good.

ericariyanto/PHP_CodeSniffer,ericariyanto/PHP_CodeSniffer,thomasjfox/PHP_CodeSniffer,ttyz/PHP_CodeSniffer,legoktm/PHP_CodeSniffer,oligriffiths/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,arnested/PHP_CodeSniffer,pfrenssen/PHP_CodeSniffer,ericariyanto/PHP_CodeSniffer,JDGrimes/PHP_CodeSniffer,R11T/PHP_CodeSniffer,thomasjfox/PHP_CodeSniffer,JDGrimes/PHP_CodeSniffer,dryabkov/PHP_CodeSniffer,revinate/PHP_CodeSniffer,stronk7/PHP_CodeSniffer,Konafets/PHP_CodeSniffer,mkuh/PHP_CodeSniffer,tophsic/PHP_CodeSniffer,scato/PHP_CodeSniffer,arnested/PHP_CodeSniffer,pfrenssen/PHP_CodeSniffer,itpatrol/PHP_CodeSniffer,rcarraretto/PHP_CodeSniffer,xwp/PHP_CodeSniffer,VANINUitgeverij/PHP_CodeSniffer,ravage84/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer,arnested/PHP_CodeSniffer,evilebottnawi/PHP_CodeSniffer,jamescauwelier/PHP_CodeSniffer,jamescauwelier/PHP_CodeSniffer,tophsic/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer,ttyz/PHP_CodeSniffer,ttyz/PHP_CodeSniffer,hu2008yinxiang/PHP_CodeSniffer,ttyz/PHP_CodeSniffer,OndraM/PHP_CodeSniffer,Konafets/PHP_CodeSniffer,legoktm/PHP_CodeSniffer,akarmazyn/PHP_CodeSniffer,Phillaf/PHP_CodeSniffer,julka/PHP_CodeSniffer,rcarraretto/PHP_CodeSniffer,dryabkov/PHP_CodeSniffer,revinate/PHP_CodeSniffer,akarmazyn/PHP_CodeSniffer,thomasjfox/PHP_CodeSniffer,oligriffiths/PHP_CodeSniffer,wimg/PHP_CodeSniffer,oligriffiths/PHP_CodeSniffer,ravage84/PHP_CodeSniffer,dryabkov/PHP_CodeSniffer,wimg/PHP_CodeSniffer,kenguest/PHP_CodeSniffer,JDGrimes/PHP_CodeSniffer,itpatrol/PHP_CodeSniffer,mkuh/PHP_CodeSniffer,Phillaf/PHP_CodeSniffer,oligriffiths/PHP_CodeSniffer,thomasjfox/PHP_CodeSniffer,phpdragon/PHP_CodeSniffer,rcarraretto/PHP_CodeSniffer,evilebottnawi/PHP_CodeSniffer,Phillaf/PHP_CodeSniffer,stronk7/PHP_CodeSniffer,akarmazyn/PHP_CodeSniffer,ericariyanto/PHP_CodeSniffer,scato/PHP_CodeSniffer,scato/PHP_CodeSniffer,evilebottnawi/PHP_CodeSniffer,xwp/PHP_CodeSniffer,mkuh/PHP_CodeSniffer,hu2008yinxiang/PHP_CodeSniffer,Konafets/PHP_CodeSniffer,revinate/PHP_CodeSniffer,itpatrol/PHP_CodeSniffer,mkuh/PHP_CodeSniffer,pfrenssen/PHP_CodeSniffer,OndraM/PHP_CodeSniffer,xwp/PHP_CodeSniffer,Konafets/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,fabacino/PHP_CodeSniffer,phpdragon/PHP_CodeSniffer,tophsic/PHP_CodeSniffer,kenguest/PHP_CodeSniffer,itpatrol/PHP_CodeSniffer,xwp/PHP_CodeSniffer,kenguest/PHP_CodeSniffer,stronk7/PHP_CodeSniffer,phpdragon/PHP_CodeSniffer,rcarraretto/PHP_CodeSniffer,fabacino/PHP_CodeSniffer,julka/PHP_CodeSniffer,VANINUitgeverij/PHP_CodeSniffer,phpdragon/PHP_CodeSniffer,OndraM/PHP_CodeSniffer,akarmazyn/PHP_CodeSniffer,julka/PHP_CodeSniffer,kenguest/PHP_CodeSniffer,julka/PHP_CodeSniffer,wimg/PHP_CodeSniffer,R11T/PHP_CodeSniffer,tophsic/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,fabacino/PHP_CodeSniffer,evilebottnawi/PHP_CodeSniffer,scato/PHP_CodeSniffer,pfrenssen/PHP_CodeSniffer,revinate/PHP_CodeSniffer,hu2008yinxiang/PHP_CodeSniffer,VANINUitgeverij/PHP_CodeSniffer,OndraM/PHP_CodeSniffer,hu2008yinxiang/PHP_CodeSniffer