Prints hook stat.

@param OutputPrinter $printer
@param string        $name
@param string        $path
@param string        $style
@param null|string   $stdOut
@param null|string   $error

@deprecated Remove in 4.0
177399
private function printStat(OutputPrinter $printer, $name, $path, $style, $stdOut, $error)
    {
        $path = $this->relativizePaths($path);
        $printer->writeln(sprintf('    {+%s}%s{-%s} {+comment}# %s{-comment}', $style, $name, $style, $path));

        $pad = function ($line) { return '      ' . $line; };

        if (null !== $stdOut) {
            $padText = function ($line) { return '      │ ' . $line; };
            $stdOutString = array_map($padText, explode("\n", $stdOut));
            $printer->writeln(implode("\n", $stdOutString));
        }

        if ($error) {
            $exceptionString = implode("\n", array_map($pad, explode("\n", $error)));
            $printer->writeln(sprintf('{+%s}%s{-%s}', $style, $exceptionString, $style));
        }

        $printer->writeln();
    }
1011254
private function printDescription(OutputPrinter $printer, FeatureNode $feature)
    {
        if (!$feature->getDescription()) {
            $printer->writeln();

            return;
        }

        foreach (explode("\n", $feature->getDescription()) as $descriptionLine) {
            $printer->writeln(sprintf('%s%s', $this->subIndentText, $descriptionLine));
        }

        $printer->writeln();
    }
504034
public void printUsage(OutputStream out, String name, boolean showHidden) {
        printUsage(new PrintWriter(new OutputStreamWriter(out, UTF_8)), name, showHidden);
    }
694881
public function printFailedHooksList(OutputPrinter $printer, $intro, array $failedHookStats)
    {
        if (!count($failedHookStats)) {
            return;
        }

        $style = $this->resultConverter->convertResultCodeToString(TestResult::FAILED);
        $intro = $this->translator->trans($intro, array(), 'output');

        $printer->writeln(sprintf('--- {+%s}%s{-%s}' . PHP_EOL, $style, $intro, $style));
        foreach ($failedHookStats as $hookStat) {
            $this->printHookStat($printer, $hookStat, $style);
        }
    }
359208
public function renderBlock(OutputBuffer $out, $name)
	{
		$method = 'block_' . $name;
		
		if(method_exists($this, $method))
		{
			$this->$method($out);
		}
		elseif($this->getParent() !== NULL)
		{
			$this->parent->renderBlock($out, $name);
		}
		else
		{
			throw new \RuntimeException(sprintf('Block not found: "%s"', $name));
		}
	}
654745
public function fireDB($name)
    {
        $args = func_get_args();
        array_shift($args);

        if (!isset($this->hooks[$name])) {
            //$this->hooks[$name] = array(array());
            return $args[0];
        }
        if (!empty($this->hooks[$name])) {
            // Sort by priority, low to high, if there's more than one priority
            if (count($this->hooks[$name]) > 1) {
                ksort($this->hooks[$name]);
            }

            $output = [];

            foreach ($this->hooks[$name] as $priority) {
                if (!empty($priority)) {
                    foreach ($priority as $callable) {
                        $output[] = call_user_func_array($callable, $args);
                    }
                }
            }

            return $output[0];
        }
    }
171868
private function printTitle(OutputPrinter $printer, $longTitle)
    {
        $description = explode("\n", $longTitle);
        $title = array_shift($description);

        if ('' !== $title) {
            $printer->write(sprintf(' %s', $title));
        }
    }
759697
public function block($name, $options=[]) {

        if (!isset($this->blocks[$name])) return null;

        $options = \array_merge([
            'print' => true
        ], $options);

        $block = \implode("\n", $this->blocks[$name]);

        if ($options['print']){
            echo $block;
        }

        return $block;
    }
1276235
public function output(string $name): void
	{
		$parent = $this->close();

		$output = current($this->blocks[$name]);

		unset($this->blocks[$name]);

		if(!empty($parent))
		{
			$output = str_replace('__PARENT__', $parent, $output);
		}

		echo $output;
	}
877824
public function configureHook(Config\Hook $config, string $name) : void
    {
        $answer = $this->io->ask('  <info>Enable \'' . $name . '\' hook?</info> <comment>[y,n]</comment> ', 'n');
        $enable = IOUtil::answerToBool($answer);

        $config->setEnabled($enable);

        if ($enable) {
            $addAction = $this->io->ask('  <info>Add a validation action?</info> <comment>[y,n]</comment> ', 'n');

            while (IOUtil::answerToBool($addAction)) {
                $config->addAction($this->getActionConfig());
                // add another action?
                $addAction = $this->io->ask(
                    '  <info>Add another validation action?</info> <comment>[y,n]</comment> ',
                    'n'
                );
            }
        }
    }
438063
public static function printUsage()
    {
        $msg = "";
        $msg .= "phing [options] [target [target2 [target3] ...]]" . PHP_EOL;
        $msg .= "Options: " . PHP_EOL;
        $msg .= "  -h -help               print this message" . PHP_EOL;
        $msg .= "  -l -list               list available targets in this project" . PHP_EOL;
        $msg .= "  -i -init [file]        generates an initial buildfile" . PHP_EOL;
        $msg .= "  -v -version            print the version information and exit" . PHP_EOL;
        $msg .= "  -q -quiet              be extra quiet" . PHP_EOL;
        $msg .= "  -S -silent             print nothing but task outputs and build failures" . PHP_EOL;
        $msg .= "  -verbose               be extra verbose" . PHP_EOL;
        $msg .= "  -debug                 print debugging information" . PHP_EOL;
        $msg .= "  -emacs, -e             produce logging information without adornments" . PHP_EOL;
        $msg .= "  -diagnostics           print diagnostics information" . PHP_EOL;
        $msg .= "  -strict                runs build in strict mode, considering a warning as error" . PHP_EOL;
        $msg .= "  -no-strict             runs build normally (overrides buildfile attribute)" . PHP_EOL;
        $msg .= "  -longtargets           show target descriptions during build" . PHP_EOL;
        $msg .= "  -logfile <file>        use given file for log" . PHP_EOL;
        $msg .= "  -logger <classname>    the class which is to perform logging" . PHP_EOL;
        $msg .= "  -listener <classname>  add an instance of class as a project listener" . PHP_EOL;
        $msg .= "  -f -buildfile <file>   use given buildfile" . PHP_EOL;
        $msg .= "  -D<property>=<value>   use value for given property" . PHP_EOL;
        $msg .= "  -keep-going, -k        execute all targets that do not depend" . PHP_EOL;
        $msg .= "                         on failed target(s)" . PHP_EOL;
        $msg .= "  -propertyfile <file>   load all properties from file" . PHP_EOL;
        $msg .= "  -propertyfileoverride  values in property file override existing values" . PHP_EOL;
        $msg .= "  -find <file>           search for buildfile towards the root of the" . PHP_EOL;
        $msg .= "                         filesystem and use it" . PHP_EOL;
        $msg .= "  -inputhandler <file>   the class to use to handle user input" . PHP_EOL;
        //$msg .= "  -recursive <file>      search for buildfile downwards and use it" . PHP_EOL;
        $msg .= PHP_EOL;
        $msg .= "Report bugs to <dev@phing.tigris.org>" . PHP_EOL;
        self::$err->write($msg);
    }
579883
protected function print_field($name, $caption, $field, $helpicon = null) {
        global $OUTPUT;
        // Attempt to generate HTML like formslib.
        echo '<div class="fitem row form-group">';
        echo '<div class="fitemtitle col-md-3">';
        if ($name) {
            echo '<label for="' . $name . '">';
        }
        echo $caption;
        if ($name) {
            echo "</label>\n";
        }
        if ($helpicon) {
            echo '<span class="pull-xs-right text-nowrap">'.$helpicon.'</span>';
        }
        echo '</div>';
        if (isset($this->errors[$name])) {
            $extraclass = ' error';
        } else {
            $extraclass = '';
        }
        echo '<div class="felement col-md-9 form-inline' . $extraclass . '">';
        echo $field;
        if (isset($this->errors[$name])) {
            echo $OUTPUT->error_text($this->errors[$name]);
        }
        echo '</div>';
        echo '</div>';
    }
1360035
private function printStepExceptionsAndStdOut(OutputPrinter $printer, array $events)
    {
        foreach ($events as $event) {
            $this->printStepStdOut($printer, $event->getTestResult());
            $this->printStepException($printer, $event->getTestResult());
        }
    }
339817
protected function printErrors(): void
    {
        $this->output->writeln('');
        $this->output->writeln('');

        foreach ($this->errors as $error) {
            $this->output->write('<fg=red>ERROR   </> ' . $error['file'] . ':' . $error['line'] . ' - ');

            if ($error['type'] == 'class') {
                $this->output->write('Class <info>' . $error['class'] . '</info> is missing a docblock.');
            }

            if ($error['type'] == 'method') {
                $this->output->write('Method <info>' . $error['method'] . '</info> is missing a docblock.');
            }

            $this->output->writeln('');
        }
    }
818171
private function printDescription(OutputPrinter $printer, $longTitle)
    {
        $lines = explode("\n", $longTitle);
        array_shift($lines);

        foreach ($lines as $line) {
            $printer->writeln(sprintf('%s%s', $this->subIndentText, $line));
        }
    }
261351
private function printTitle(OutputPrinter $printer, ExampleNode $example)
    {
        $printer->write(sprintf('%s%s', $this->indentText, $example->getTitle()));
    }
994836
public static function macro($name, $macro)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        call_user_func_array(array($html, __FUNCTION__), $args);
    }