
| Current Path : /var/www/html/vendor/enlightn/security-checker/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/vendor/enlightn/security-checker/src/JsonFormatter.php |
<?php
namespace Enlightn\SecurityChecker;
use Exception;
use Symfony\Component\Console\Output\OutputInterface;
class JsonFormatter implements FormatterInterface
{
/**
* Display the result.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param array $result
* @return void
*/
public function displayResult(OutputInterface $output, array $result)
{
$output->writeln(json_encode($result, JSON_PRETTY_PRINT));
}
/**
* Display the error.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Exception $exception
* @return void
*/
public function displayError(OutputInterface $output, Exception $exception)
{
$output->writeln(json_encode([
'error' => $exception->getMessage(),
], JSON_PRETTY_PRINT));
}
}