feat: first impl

This commit is contained in:
2025-08-16 21:48:01 +02:00
parent e60ab9d7bc
commit 209c910f33
14 changed files with 444 additions and 0 deletions

32
src/Stdio.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Nih\CommandBuilder;
use Stringable;
abstract class Stdio
{
abstract public function getDescriptorSpec(): array;
public static function file(string|Stringable $file, string $mode): self
{
return new StdioFile((string) $file, $mode);
}
public static function piped(string $mode): self
{
return new StdioPiped($mode);
}
public static function inherit(): null
{
return null;
}
public static function null(): self
{
return new StdioFile('/dev/null', 'a+');
}
}