StackFormation\Command\Stack\Show\AbstractShowCommand::executeWithStack PHP Метод

executeWithStack() защищенный Метод

protected executeWithStack ( Stack $stack, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$stack StackFormation\Stack
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function executeWithStack(Stack $stack, InputInterface $input, OutputInterface $output)
    {
        $methodName = 'get' . ucfirst($this->property);
        $key = $input->getArgument('key');
        if ($key) {
            $methodName = substr($methodName, 0, -1);
            $output->writeln($stack->{$methodName}($key));
            return;
        }
        $data = $stack->{$methodName}();
        $rows = [];
        foreach ($data as $k => $v) {
            $v = strlen($v) > 100 ? substr($v, 0, 100) . "..." : $v;
            $rows[] = [$k, $v];
        }
        $table = new Table($output);
        $table->setHeaders(['Key', 'Value'])->setRows($rows)->render();
    }