test: CI/CD pipeline staging test

This commit is contained in:
2025-11-08 11:16:01 +01:00
parent 9e77ac3b42
commit 7093693cfb
3 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1 @@
# CI/CD Pipeline Test - Sat Nov 8 11:16:01 AM CET 2025

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Framework\Console\Animation\Types;
/**
* Direction enum for slide animations
*/
enum SlideDirection: string
{
case LEFT = 'left';
case RIGHT = 'right';
case UP = 'up';
case DOWN = 'down';
}

View File

@@ -0,0 +1,72 @@
<?php
namespace App\Framework\Console\Ansi;
/**
* Truecolor Style Value Object
*/
final readonly class TruecolorStyle
{
public function __construct(
private ?RgbColor $foreground = null,
private ?RgbColor $background = null,
private ?\App\Framework\Console\ConsoleFormat $format = null
) {}
/**
* Create truecolor style
*/
public static function create(
?RgbColor $foreground = null,
?RgbColor $background = null,
?\App\Framework\Console\ConsoleFormat $format = null
): self
{
return new self($foreground, $background, $format);
}
/**
* Apply style to text with automatic fallback
*/
public function apply(
string $text,
AnsiSequenceGenerator $generator,
TerminalCapabilities $capabilities
): string
{
$codes = [];
if ($this->format !== null) {
$codes[] = $this->format->value;
}
if ($this->foreground !== null) {
if ($capabilities->supportsTruecolor()) {
$codes[] = "38;2;{$this->foreground->r};{$this->foreground->g};{$this->foreground->b}";
} else {
// Fallback to standard color
$fallback = $this->foreground->toNearestColor();
$codes[] = $fallback->value;
}
}
if ($this->background !== null) {
if ($capabilities->supportsTruecolor()) {
$codes[] = "48;2;{$this->background->r};{$this->background->g};{$this->background->b}";
} else {
// Fallback to standard background color
$fallback = $this->background->toNearestBackgroundColor();
$codes[] = $fallback->value;
}
}
if (empty($codes)) {
return $text;
}
$ansi = "\033[" . implode(';', $codes) . 'm';
$reset = ConsoleColor::RESET->toAnsi();
return $ansi . $text . $reset;
}
}