7 private static array $functions;
8 private static array $libsClasses = [
9 'logic' => Libs\LogicLib::class,
10 'string' => Libs\StringLib::class,
11 'math' => Libs\MathLib::class,
12 'date' => Libs\DateLib::class,
13 'array' => Libs\ArrayLib::class,
14 'document' => Libs\DocumentLib::class,
19 if (!isset(static::$functions))
21 static::$functions = [];
22 foreach (static::getLibs() as $lib)
24 static::$functions += static::getLibFunctions($lib);
28 return static::$functions;
34 protected static function getLibs(): array
39 foreach (static::$libsClasses as $libClass)
41 $libs[] =
new $libClass();
52 static function($function) use ($lib)
54 $function[
'func'] = \Closure::fromCallable([$lib, $function[
'func']]);