Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function processParams(array $config, array $expectedParams, array $actu
// Add the params coming from the environment values
$actualParams = array_replace($actualParams, $this->getEnvValues($envMap));

return $this->getParams($expectedParams, $actualParams);
return $this->getParams($expectedParams, $actualParams, $config);
}

private function getEnvValues(array $envMap)
Expand Down Expand Up @@ -137,7 +137,7 @@ private function processRenamedValues(array $renameMap, array $actualParams)
return $actualParams;
}

private function getParams(array $expectedParams, array $actualParams)
private function getParams(array $expectedParams, array $actualParams, array $config = array())
{
// Simply use the expectedParams value as default for the missing params.
if (!$this->io->isInteractive()) {
Expand All @@ -153,7 +153,11 @@ private function getParams(array $expectedParams, array $actualParams)

if (!$isStarted) {
$isStarted = true;
$this->io->write('<comment>Some parameters are missing. Please provide them.</comment>');
if (empty($config['comment'])) {
$this->io->write('<comment>Some parameters are missing. Please provide them.</comment>');
} else {
$this->io->write('<comment>' . $config['comment'] . '</comment>');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would use sprintf() here

}
}

$default = Inline::dump($message);
Expand Down