src/Middleware.php
public static function requestBuilder(callable $serializer)
    {
        return function (callable $handler) use ($serializer) {
            return function (CommandInterface $command) use ($serializer, $handler) {
                return $handler($command, $serializer($command));
            };
        };
    }
public static function requestBuilder(callable $serializer)
    {
        return function (callable $handler) use ($serializer) {
            return function (CommandInterface $command) use ($serializer, $handler) {
                return $handler($command, $serializer($command));
            };
        };
    }
public static function requestBuilder ( callable $ serializer ) { return function ( callable $ handler ) use ( $ serializer ) { return function ( CommandInterface $ command ) use ( $ serializer , $ handler ) { return $ handler ( $ command , $ serializer ( $ command ) ) ; } ; } ; }
Builds an HTTP request for a command.

@param callable $serializer Function used to serialize a request for a
command.
@return callable
Builds an HTTP request for a command .