sebastianbergmann/phpcpd — Issue #34: --exclude commandline param processing error
Author: FranPregernik
Created: 2011-10-20 18:03:06+00:00
State: open

Hi,

I saw sam previous issues regarding this but after some debugging I saw an little error in: https://github.com/sebastianbergmann/phpcpd/blob/master/PHPCPD/TextUI/Command.php (lines 194 through 196)
```php
if (is_array($exclude) && (count($exclude) == 1)) {
array_map('trim', explode(',', array_pop($exclude)));
}
```

$exclude is used afterwards but because of array_pop the array is cleared there is only one --exclude param specified

Here is how I think it should look like:
```php
if (is_array($exclude) && (count($exclude) == 1)) {
$exclude = array_map('trim', explode(',', array_pop($exclude)));
}
```

Best reagrds,
Fran