modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2024-07-02 09:55:22 +04:00
parent e605dd3876
commit a46111d089
3 changed files with 9 additions and 6 deletions

View File

@ -76,11 +76,11 @@ class ProxyMessenger implements IMessenger {
$useFunc = false; $useFunc = false;
$untils = []; $untils = [];
foreach ($this->msgs as $msg) { foreach ($this->msgs as $msg) {
$msg->action($content, null, $level);
if ($msg instanceof _IMessenger) { if ($msg instanceof _IMessenger) {
$useFunc = true; $useFunc = true;
$untils[] = $msg->_getActionMark(); $untils[] = $msg->_getActionMark();
} }
$msg->action($content, null, $level);
} }
if ($useFunc && $func !== null) { if ($useFunc && $func !== null) {
try { try {

View File

@ -306,12 +306,12 @@ class StdMessenger implements _IMessenger {
$rprefix2 = str_repeat(" ", mb_strlen($rprefix)); $rprefix2 = str_repeat(" ", mb_strlen($rprefix));
} }
if ($printContent && $printResult) { if ($printContent && $printResult) {
A::ensure_array($content);
if ($rcontent) { if ($rcontent) {
A::ensure_array($content);
$content[] = ": "; $content[] = ": ";
$content[] = $rcontent; $content[] = $rcontent;
} }
$lines = $out->getLines(false, $content); $lines = $out->getLines(false, ...$content);
foreach ($lines as $content) { foreach ($lines as $content) {
if ($linePrefix !== null) $out->write($linePrefix); if ($linePrefix !== null) $out->write($linePrefix);
$out->iprint($indentLevel, $rprefix, $content); $out->iprint($indentLevel, $rprefix, $content);
@ -331,7 +331,9 @@ class StdMessenger implements _IMessenger {
$prefix2 = str_repeat(" ", mb_strlen($prefix)); $prefix2 = str_repeat(" ", mb_strlen($prefix));
$suffix = null; $suffix = null;
} }
$lines = $out->getLines(false, $content, ":"); A::ensure_array($content);
$content[] = ":";
$lines = $out->getLines(false, ...$content);
foreach ($lines as $content) { foreach ($lines as $content) {
if ($linePrefix !== null) $out->write($linePrefix); if ($linePrefix !== null) $out->write($linePrefix);
$out->iprint($indentLevel, $prefix, $content, $suffix); $out->iprint($indentLevel, $prefix, $content, $suffix);
@ -399,7 +401,8 @@ class StdMessenger implements _IMessenger {
$valueContent[] = $value; $valueContent[] = $value;
} }
} }
$content = $valueContent; if (count($valueContent) == 1) $content = $valueContent[0];
else $content = $valueContent;
} elseif ($content instanceof Throwable || $content instanceof ExceptionShadow) { } elseif ($content instanceof Throwable || $content instanceof ExceptionShadow) {
$exceptions[] = $content; $exceptions[] = $content;
$content = null; $content = null;

View File

@ -206,7 +206,7 @@ Application::run(new class extends Application {
$msg->info("info"); $msg->info("info");
$msg->note("note"); $msg->note("note");
$msg->warn("warning"); $msg->warning("warning");
$msg->error("error"); $msg->error("error");
}); });
}); });