Initial commit after splitting from main project
PHP Composer / build (push) Successful in 38s

This commit is contained in:
2026-07-26 17:27:01 +02:00
commit afc5538e56
24 changed files with 1431 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Tez\Utils\Fn;
/**
* Pre-fills the leading arguments of a callable and returns a new Closure
* that accepts the remaining arguments.
*/
final class Partial
{
/**
* Returns a Closure with $partial pre-filled as the leftmost arguments.
* The returned Closure forwards any additional arguments to $fn.
*/
public static function apply(callable $fn, mixed ...$partial): \Closure
{
return static function () use ($fn, $partial): mixed {
return $fn(...$partial, ...func_get_args());
};
}
}