From ce1b7f86cd72af04c92a71d66456eaa3cd065478 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 5 Apr 2024 10:19:15 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/output/out.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/output/out.php b/src/output/out.php index 7430935..59f7339 100644 --- a/src/output/out.php +++ b/src/output/out.php @@ -8,26 +8,27 @@ use nur\sery\output\std\StdOutput; */ class out { /** @var StdOutput */ - protected static $out; + private static $out; + + static function get(): StdOutput { + return self::$out; + } + protected static function set(StdOutput $out): StdOutput { + return self::$out = $out; + } /** reparamétrer l'instance */ static function reset($output=null, ?array $params=null): StdOutput { - if (self::$out === null) { - return self::$out = new StdOutput($output, $params); - } + if (self::$out === null) return self::set(new StdOutput($output, $params)); if ($output !== null) $params["output"] = $output; self::$out->resetParams($params); return self::$out; } - static function get(): StdOutput { - if (self::$out !== null) return self::$out; - else return self::reset(); - } + static function write(...$values): void { self::$out->write(...$values); } + static function print(...$values): void { self::$out->print(...$values); } - static function write(...$values): void { self::get()->write(...$values); } - static function print(...$values): void { self::get()->print(...$values); } - - static function iwrite(int $indentLevel, ...$values): void { self::get()->iwrite($indentLevel, ...$values); } - static function iprint(int $indentLevel, ...$values): void { self::get()->iprint($indentLevel, ...$values); } + static function iwrite(int $indentLevel, ...$values): void { self::$out->iwrite($indentLevel, ...$values); } + static function iprint(int $indentLevel, ...$values): void { self::$out->iprint($indentLevel, ...$values); } } +out::reset();