Improvement with rtrim
This commit is contained in:
parent
9c7a1c7907
commit
d49cecf40a
|
@ -74,7 +74,7 @@ class PhpCpd implements \PHPCI\Plugin
|
||||||
if (count($this->ignore)) {
|
if (count($this->ignore)) {
|
||||||
$map = function ($item) {
|
$map = function ($item) {
|
||||||
// remove the trailing slash
|
// remove the trailing slash
|
||||||
$item = (substr($item, -1) == '/' ? substr($item, 0, -1) : $item);
|
$item = rtrim($item, '/');
|
||||||
|
|
||||||
if (is_file($this->path . '/' . $item)) {
|
if (is_file($this->path . '/' . $item)) {
|
||||||
return ' --names-exclude ' . $item;
|
return ' --names-exclude ' . $item;
|
||||||
|
|
|
@ -71,7 +71,7 @@ class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
||||||
$ignore = '';
|
$ignore = '';
|
||||||
if (count($this->phpci->ignore)) {
|
if (count($this->phpci->ignore)) {
|
||||||
$map = function ($item) {
|
$map = function ($item) {
|
||||||
return ' --exclude ' . (substr($item, -1) == '/' ? substr($item, 0, -1) : $item);
|
return ' --exclude ' . rtrim($item, '/');
|
||||||
};
|
};
|
||||||
$ignore = array_map($map, $this->phpci->ignore);
|
$ignore = array_map($map, $this->phpci->ignore);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue