diff --git a/src/Util/Common.php b/src/Util/Common.php index ec1b1ca7c7..ca8b5b81be 100644 --- a/src/Util/Common.php +++ b/src/Util/Common.php @@ -442,8 +442,14 @@ public static function cleanSniffClass($sniffClass) return $newName; } - $end = (strlen($newName) - $sniffPos + 1); - $start = strrpos($newName, '\\', ($end * -1)); + $end = (strlen($newName) - $sniffPos + 1); + $start = strrpos($newName, '\\', ($end * -1)); + + if ($start === false) { + // Nothing needs to be cleaned. + return $newName; + } + $newName = substr($newName, ($start + 1)); return $newName;