Fluent Function

no-email (Damien Seguy), Damien Seguy
Fri, 03 Jan 2025 00:00:00 +0000

A fluent interface allows the chaining of method calls. It is a bit harder to do with functions, as there is no supporting object, but it is possible.
Returning ``__FUNCTION__`` allows the subsequent call of the same function.
Returning a closure of itself is also possible, yet a bit more cumbersome, as ``__FUNCTION__`` is not recognized as a string for a function call.
Thanks to Andreas Heigl for the inspiration.