test: CI/CD pipeline staging test
This commit is contained in:
1
deployment/TEST_PIPELINE.md
Normal file
1
deployment/TEST_PIPELINE.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# CI/CD Pipeline Test - Sat Nov 8 11:16:01 AM CET 2025
|
||||||
14
src/Framework/Console/Animation/Types/SlideDirection.php
Normal file
14
src/Framework/Console/Animation/Types/SlideDirection.php
Normal 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';
|
||||||
|
}
|
||||||
72
src/Framework/Console/Ansi/TruecolorStyle.php
Normal file
72
src/Framework/Console/Ansi/TruecolorStyle.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user