private function extended(callable $factory, callable ...$extensions): callable
    {
        return array_reduce($extensions, function ($factory, $extension) {
            return new Extension($factory, $extension);
        }, $factory);
    }
private function extended(callable $factory, callable ...$extensions): callable
    {
        return array_reduce($extensions, function ($factory, $extension) {
            return new Extension($factory, $extension);
        }, $factory);
    }
private function extended ( callable $ factory , callable ... $ extensions ) : callable { return array_reduce ( $ extensions , function ( $ factory , $ extension ) { return new Extension ( $ factory , $ extension ) ; } , $ factory ) ; }
Return an extension from the given callables.

@param callable $factory
@param callable ...$extensions
@return callable
Return an extension from the given callables .