mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-12 19:21:33 +00:00
updated streamline-setup v2
This commit is contained in:
@@ -30,7 +30,7 @@ abstract class Command extends BaseCommand
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setApplication(Application $application = null): void
|
||||
public function setApplication(?Application $application = null): void
|
||||
{
|
||||
if ($application !== null && !$application instanceof Shell) {
|
||||
throw new \InvalidArgumentException('PsySH Commands require an instance of Psy\Shell');
|
||||
@@ -39,6 +39,19 @@ abstract class Command extends BaseCommand
|
||||
parent::setApplication($application);
|
||||
}
|
||||
|
||||
/**
|
||||
* getApplication, but is guaranteed to return a Shell instance.
|
||||
*/
|
||||
protected function getShell(): Shell
|
||||
{
|
||||
$shell = $this->getApplication();
|
||||
if (!$shell instanceof Shell) {
|
||||
throw new \RuntimeException('PsySH Commands require an instance of Psy\Shell');
|
||||
}
|
||||
|
||||
return $shell;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -140,9 +153,11 @@ abstract class Command extends BaseCommand
|
||||
$default = '';
|
||||
}
|
||||
|
||||
$name = $argument->getName();
|
||||
$pad = \str_pad('', $max - \strlen($name));
|
||||
$description = \str_replace("\n", "\n".\str_pad('', $max + 2, ' '), $argument->getDescription());
|
||||
|
||||
$messages[] = \sprintf(" <info>%-{$max}s</info> %s%s", $argument->getName(), $description, $default);
|
||||
$messages[] = \sprintf(' <info>%s</info>%s %s%s', $name, $pad, $description, $default);
|
||||
}
|
||||
|
||||
$messages[] = '';
|
||||
|
||||
Reference in New Issue
Block a user