StackFormation\Command\Stack\Show\DependantsCommand::executeWithStack PHP Method

executeWithStack() protected method

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)
    {
        $this->dependencyTracker->reset();
        foreach ($this->blueprintFactory->getAllBlueprints() as $blueprint) {
            $blueprint->getPreprocessedTemplate();
        }
        $dependants = $this->dependencyTracker->findDependantsForStack($stack->getName());
        $rows = [];
        foreach ($dependants as $dependant) {
            $rows[] = [$dependant['targetType'] . ':' . $dependant['targetResource'], $dependant['type'] . ':' . $dependant['blueprint'] . ':' . $dependant['key']];
        }
        $output->writeln("Following blueprints depend on stack '{$stack->getName()}':");
        $table = new Table($output);
        $table->setHeaders(['Origin (Stack: ' . $stack->getName() . ')', 'Blueprint'])->setRows($rows)->render();
    }