diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php index 953c3ea7..125e13eb 100644 --- a/PHPCI/Plugin/PhpCpd.php +++ b/PHPCI/Plugin/PhpCpd.php @@ -74,7 +74,7 @@ class PhpCpd implements \PHPCI\Plugin if (count($this->ignore)) { $map = function ($item) { // remove the trailing slash - $item = (substr($item, -1) == '/' ? substr($item, 0, -1) : $item); + $item = rtrim($item, '/'); if (is_file($this->path . '/' . $item)) { return ' --names-exclude ' . $item; diff --git a/PHPCI/Plugin/PhpLoc.php b/PHPCI/Plugin/PhpLoc.php index 76887493..eb5af6ff 100644 --- a/PHPCI/Plugin/PhpLoc.php +++ b/PHPCI/Plugin/PhpLoc.php @@ -71,7 +71,7 @@ class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $ignore = ''; if (count($this->phpci->ignore)) { $map = function ($item) { - return ' --exclude ' . (substr($item, -1) == '/' ? substr($item, 0, -1) : $item); + return ' --exclude ' . rtrim($item, '/'); }; $ignore = array_map($map, $this->phpci->ignore);