squizlabs/PHP_CodeSniffer — pull request #370 by klausi (2014-12-14 19:23:26+00:00)
Title: Add configurable PHP namespace prefix for sniffs

I want to use PHP namespaces for the Drupal coding standard to have reliable PSR-4 autoloading during test runs and when the standard is used as library.

PHPCS currently forces me to use the namespace "Drupal\Sniffs\Commenting", but I actually want "Drupal\coder\Drupal\Sniffs\Commenting" because the sniffs live in the coder library on drupal.org.

So I invented a nsPrefix config option so that I can specify "Drupal\coder\" in my ruleset.xml. Otherwise instantiating the sniff classes fails with a fatal error because there is the namespace mismatch. Is this the right approach?