chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace App\Framework\Console\Examples;
use App\Framework\Console\Components\Table;
use App\Framework\Console\ConsoleCommand;
use App\Framework\Console\ConsoleColor;
use App\Framework\Console\ConsoleFormat;
use App\Framework\Console\ConsoleInput;
use App\Framework\Console\ConsoleOutput;
use App\Framework\Console\ConsoleStyle;
final class TableExample
{
#[ConsoleCommand('demo:table', 'Zeigt eine Beispiel-Tabelle')]
public function showTable(ConsoleInput $input, ConsoleOutput $output): int
{
$output->writeLine('Beispiel für die Table-Komponente', ConsoleStyle::create(
color: ConsoleColor::BRIGHT_WHITE,
format: ConsoleFormat::BOLD
));
$output->newLine();
// Einfache Tabelle
$table = new Table(
headerStyle: ConsoleStyle::create(color: ConsoleColor::BRIGHT_YELLOW, format: ConsoleFormat::BOLD),
borderStyle: ConsoleStyle::create(color: ConsoleColor::CYAN)
);
$table->setHeaders(['Name', 'Alter', 'Stadt'])
->addRow(['Max Mustermann', '30', 'Berlin'])
->addRow(['Anna Schmidt', '25', 'München'])
->addRow(['Peter Weber', '35', 'Hamburg']);
$output->write($table->render());
$output->newLine();
// Komplexere Tabelle mit Produktdaten
$output->writeLine('Produktübersicht:', ConsoleStyle::create(color: ConsoleColor::BRIGHT_GREEN));
$productTable = new Table(
headerStyle: ConsoleStyle::create(color: ConsoleColor::BRIGHT_WHITE, format: ConsoleFormat::BOLD),
rowStyle: ConsoleStyle::create(color: ConsoleColor::WHITE),
borderStyle: ConsoleStyle::create(color: ConsoleColor::GRAY)
);
$productTable->setHeaders(['Artikel-Nr.', 'Bezeichnung', 'Preis', 'Lagerbestand', 'Status'])
->setPadding(2)
->addRow(['A-1001', 'Tastatur Deluxe', '89,99 €', '45', 'Verfügbar'])
->addRow(['A-1002', 'Gaming Maus Pro', '69,99 €', '12', 'Knapp'])
->addRow(['A-1003', '4K Monitor 27"', '349,99 €', '0', 'Ausverkauft'])
->addRow(['A-1004', 'USB-C Kabel 2m', '19,99 €', '156', 'Verfügbar'])
->addRow(['A-1005', 'Wireless Headset', '129,99 €', '8', 'Knapp']);
$output->write($productTable->render());
return 0;
}
}