public static function addJwt(JwtAuth $jwt) {
    return function (callable $handler) use ($jwt) {
      return function (
        RequestInterface $request,
        array $options
      ) use (
        $handler,
        $jwt
      ) {
        $request = $request->withHeader('Authorization', 'Bearer ' . $jwt->generateToken());
        return $handler($request, $options);
      };
    };
  }
public static function addJwt(JwtAuth $jwt) {
    return function (callable $handler) use ($jwt) {
      return function (
        RequestInterface $request,
        array $options
      ) use (
        $handler,
        $jwt
      ) {
        $request = $request->withHeader('Authorization', 'Bearer ' . $jwt->generateToken());
        return $handler($request, $options);
      };
    };
  }
public static function addJwt ( JwtAuth $ jwt ) { return function ( callable $ handler ) use ( $ jwt ) { return function ( RequestInterface $ request , array $ options ) use ( $ handler , $ jwt ) { $ request = $ request -> withHeader ( 'Authorization' , 'Bearer ' . $ jwt -> generateToken ( ) ) ; return $ handler ( $ request , $ options ) ; } ; } ; }
Guzzle middleware to add a header to outgoing requests.

@param \Drupal\jwt\Authentication\Provider\JwtAuth $jwt
JWT.
Guzzle middleware to add a header to outgoing requests .