Skip to content

Commit

Permalink
Validate first colon on palceholder. (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Dec 12, 2016
1 parent ef13299 commit b0b7377
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Command/Shared/InputTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ private function inlineValueAsArray($inputValue)
$inputArrayValue = [];
foreach ($inputValue as $key => $value) {
if (!is_array($value)) {
$inputValueItems = [];
foreach (explode(" ", $value) as $inputKeyValueItem) {
list($inputKeyItem, $inputValueItem) = explode(":", $inputKeyValueItem);
$inputValueItems[$inputKeyItem] = $inputValueItem;
$separatorIndex = strpos($value, ':');
if (!$separatorIndex) {
continue;
}
$inputArrayValue[$key] = $inputValueItems;
$inputKeyItem = substr($value, 0, $separatorIndex);
$inputValueItem = substr($value, $separatorIndex+1);
$inputArrayValue[$key] = [$inputKeyItem => $inputValueItem];
}
}

Expand Down

0 comments on commit b0b7377

Please sign in to comment.