Files
Virtnet.bond/vendor/dedoc/scramble/src/Console/Commands/Components/Code.php
2026-03-12 22:47:38 +01:00

22 lines
468 B
PHP

<?php
namespace Dedoc\Scramble\Console\Commands\Components;
use Illuminate\Console\OutputStyle;
use NunoMaduro\Collision\Highlighter;
class Code implements Component
{
public function __construct(
public string $filePath,
public int $line,
) {}
public function render(OutputStyle $style): void
{
$code = (new Highlighter)->highlight(file_get_contents($this->filePath), $this->line);
$style->writeln($code);
}
}