protected function getValueOfCurrentCommandLineOption($currentArgument, array &$rawCommandLineArguments, $expectedArgumentType)
{
if (!isset($rawCommandLineArguments[0]) && strpos($currentArgument, '=') === false || isset($rawCommandLineArguments[0]) && $rawCommandLineArguments[0][0] === '-' && strpos($currentArgument, '=') === false) {
return true;
}
if (strpos($currentArgument, '=') === false) {
$possibleValue = trim(array_shift($rawCommandLineArguments));
if (strpos($possibleValue, '=') === false) {
if ($expectedArgumentType !== 'boolean') {
return $possibleValue;
}
if (array_search($possibleValue, ['on', '1', 'y', 'yes', 'true', 'TRUE']) !== false) {
return true;
}
if (array_search($possibleValue, ['off', '0', 'n', 'no', 'false', 'FALSE']) !== false) {
return false;
}
array_unshift($rawCommandLineArguments, $possibleValue);
return true;
}
$currentArgument .= $possibleValue;
}
$splitArgument = explode('=', $currentArgument, 2);
while ((!isset($splitArgument[1]) || trim($splitArgument[1]) === '') && count($rawCommandLineArguments) > 0) {
$currentArgument .= array_shift($rawCommandLineArguments);
$splitArgument = explode('=', $currentArgument);
}
$value = isset($splitArgument[1]) ? $splitArgument[1] : '';
return $value;
}