Skip to content

Commit

Permalink
Robustly handle trailing delimiters in CommandFileDiscovery. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson authored Dec 16, 2016
1 parent cd3bc8e commit 7332a4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CommandFileDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@ function ($item) {
*/
protected function joinParts($delimiter, $parts, $filterFunction)
{
$parts = array_map(
function ($item) use ($delimiter) {
return rtrim($item, $delimiter);
},
$parts
);
return implode(
$delimiter,
array_filter($parts, $filterFunction)
Expand Down

0 comments on commit 7332a4a

Please sign in to comment.