utiliser nur_func

This commit is contained in:
Jephté Clain 2025-04-29 10:58:32 +04:00
parent 12664f7270
commit 69caadfb15

View File

@ -6,7 +6,6 @@ use nulib\file\tab\AbstractBuilder;
use nulib\file\tab\TAbstractBuilder; use nulib\file\tab\TAbstractBuilder;
use nulib\os\path; use nulib\os\path;
use nulib\php\func; use nulib\php\func;
use nulib\php\nur_func;
use nulib\php\time\Date; use nulib\php\time\Date;
use nulib\php\time\DateTime; use nulib\php\time\DateTime;
use nulib\ref\ext\spout\ref_builder; use nulib\ref\ext\spout\ref_builder;
@ -121,7 +120,7 @@ class SpoutBuilder extends AbstractBuilder {
$right = $borderDef["right"] ?? null; $right = $borderDef["right"] ?? null;
$bottom = $borderDef["bottom"] ?? null; $bottom = $borderDef["bottom"] ?? null;
$left = $borderDef["left"] ?? null; $left = $borderDef["left"] ?? null;
self::add_border_part($border, "top", $top); self::add_border_part($border, "top", $top);
self::add_border_part($border, "right", $right); self::add_border_part($border, "right", $right);
self::add_border_part($border, "bottom", $bottom); self::add_border_part($border, "bottom", $bottom);
@ -324,13 +323,8 @@ class SpoutBuilder extends AbstractBuilder {
} }
if (array_key_exists("cook_func", $sheetParams)) { if (array_key_exists("cook_func", $sheetParams)) {
$cookFunc = $sheetParams["cook_func"] ?? null; $cookFunc = $sheetParams["cook_func"] ?? null;
$cookCtx = $cookArgs = null; if ($cookFunc !== null) $cookFunc = func::with($cookFunc)->bind($this);
if ($cookFunc !== null) { $this->cookFunc = $cookFunc;
nur_func::ensure_func($cookFunc, $this, $cookArgs);
$cookCtx = nur_func::_prepare($cookFunc);
}
$this->cookCtx = $cookCtx;
$this->cookArgs = $cookArgs;
} }
} }
return $this; return $this;