chore: complete update
This commit is contained in:
39
src/Framework/Debug/Outputs/ConsoleOutput.php
Normal file
39
src/Framework/Debug/Outputs/ConsoleOutput.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Debug\Outputs;
|
||||
|
||||
use App\Framework\Debug\DebugEntry;
|
||||
use App\Framework\Debug\Formatters\FormatterInterface;
|
||||
use App\Framework\Debug\OutputInterface;
|
||||
|
||||
/**
|
||||
* Ausgabeklasse für Konsolen-Umgebungen.
|
||||
*/
|
||||
final class ConsoleOutput implements OutputInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function output(DebugEntry $entry, FormatterInterface $formatter): void
|
||||
{
|
||||
fwrite(STDOUT, $formatter->format($entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function outputHistory(array $entries, FormatterInterface $formatter): void
|
||||
{
|
||||
fwrite(STDOUT, $formatter->formatHistory($entries));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function outputRaw(string $text): void
|
||||
{
|
||||
fwrite(STDOUT, $text);
|
||||
}
|
||||
}
|
||||
39
src/Framework/Debug/Outputs/HtmlOutput.php
Normal file
39
src/Framework/Debug/Outputs/HtmlOutput.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Debug\Outputs;
|
||||
|
||||
use App\Framework\Debug\DebugEntry;
|
||||
use App\Framework\Debug\Formatters\FormatterInterface;
|
||||
use App\Framework\Debug\OutputInterface;
|
||||
|
||||
/**
|
||||
* Ausgabeklasse für HTML-Umgebungen.
|
||||
*/
|
||||
final class HtmlOutput implements OutputInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function output(DebugEntry $entry, FormatterInterface $formatter): void
|
||||
{
|
||||
echo $formatter->format($entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function outputHistory(array $entries, FormatterInterface $formatter): void
|
||||
{
|
||||
echo $formatter->formatHistory($entries);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function outputRaw(string $text): void
|
||||
{
|
||||
echo "<div class='debug-raw'>", htmlspecialchars($text), "</div>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user