1 | <?php |
||
6 | final class Phln |
||
7 | { |
||
8 | const __ = '_phln_fn_partial_placeholder'; |
||
9 | |||
10 | protected static $macros = []; |
||
11 | |||
12 | private function __construct() |
||
15 | |||
16 | /** |
||
17 | * Makes an alias for given macro |
||
18 | * |
||
19 | * @param string $macroName |
||
20 | * @param string $targetMacro |
||
21 | */ |
||
22 | public static function alias(string $macroName, string $targetMacro) |
||
26 | |||
27 | /** |
||
28 | * Returns "reference" to one of Phln macros or methods |
||
29 | * |
||
30 | * @param string $macroName |
||
31 | * @return callable |
||
32 | */ |
||
33 | public static function raw(string $macroName): callable |
||
39 | |||
40 | public static function arity(callable $fn): int |
||
46 | |||
47 | public static function curry(callable $fn, array $args = []) |
||
51 | |||
52 | public static function curryN(int $n, callable $fn, array $args = []) |
||
56 | |||
57 | public static function macro(string $name, callable $macro) |
||
61 | |||
62 | public static function hasMacro(string $name): bool |
||
66 | |||
67 | public static function __callStatic($method, $parameters) |
||
75 | } |
||
76 |