Skip to content

Commit

Permalink
Sanity check - handle the case where nothing needs to be cleaned (ref…
Browse files Browse the repository at this point in the history
… #1451)
  • Loading branch information
gsherwood committed May 9, 2017
1 parent d429124 commit 4aff5b2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Util/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4aff5b2

Please sign in to comment.