StackFormation\Diff::diffTemplates PHP Метод

diffTemplates() публичный Метод

public diffTemplates ( )
    public function diffTemplates()
    {
        $templateStack = trim($this->stack->getTemplate());
        $templateBlueprint = trim($this->blueprint->getPreprocessedTemplate());
        $templateStack = $this->normalizeJson($templateStack);
        $templateBlueprint = $this->normalizeJson($templateBlueprint);
        $returnVar = $this->printDiff($templateStack, $templateBlueprint);
        if ($returnVar == 0) {
            $this->output->writeln('No changes' . "\n");
        }
    }

Usage Example

Пример #1
0
 protected function executeWithStack(Stack $stack, InputInterface $input, OutputInterface $output)
 {
     $blueprint = $this->blueprintFactory->getBlueprintByStack($stack);
     $diff = new Diff($output);
     $diff->setStack($stack)->setBlueprint($blueprint);
     $formatter = new FormatterHelper();
     $output->writeln("\n" . $formatter->formatBlock(['Parameters:'], 'error', true) . "\n");
     $diff->diffParameters();
     $output->writeln("\n" . $formatter->formatBlock(['Template:'], 'error', true) . "\n");
     $diff->diffTemplates();
 }