BUGFIX: Prefix classes with slash to prevent issues

* As we might be in a namespace, we have to prefix new class names with
  a leading slash
This commit is contained in:
Daniel Siepmann 2017-03-07 12:04:01 +01:00
parent f4fbbcab77
commit 1aaf0e5840

View file

@ -85,7 +85,7 @@ class Typo3Update_Sniffs_Legacy_ClassnamesSniff implements PHP_CodeSniffer_Sniff
if ($fix === true) { if ($fix === true) {
switch ($tokens[$stackPtr]['code']) { switch ($tokens[$stackPtr]['code']) {
case T_IMPLEMENTS: case T_IMPLEMENTS:
$phpcsFile->fixer->replaceToken($classnamePosition, $this->getNewClassname($classname)); $phpcsFile->fixer->replaceToken($classnamePosition, '\\' . $this->getNewClassname($classname));
break; break;
default: default: