Service/AtlassianRestClient.php
private function createClient(): Client
    {
        $stack = new HandlerStack();
        $stack->setHandler(new CurlHandler());

        if ($this->user === null) {
            $stack->push(GuzzleJWTMiddleware::authTokenMiddleware(
                $this->tenant->getAddonKey(),
                $this->tenant->getSharedSecret()
            ));
        } else {
            $stack->push(GuzzleJWTMiddleware::authUserTokenMiddleware(
                $this->tenant->getOauthClientId(),
                $this->tenant->getSharedSecret(),
                $this->tenant->getBaseUrl(),
                $this->user
            ));
        }

        return new Client(['handler' => $stack]);
    }
private function createClient(): Client
    {
        $stack = new HandlerStack();
        $stack->setHandler(new CurlHandler());

        if ($this->user === null) {
            $stack->push(GuzzleJWTMiddleware::authTokenMiddleware(
                $this->tenant->getAddonKey(),
                $this->tenant->getSharedSecret()
            ));
        } else {
            $stack->push(GuzzleJWTMiddleware::authUserTokenMiddleware(
                $this->tenant->getOauthClientId(),
                $this->tenant->getSharedSecret(),
                $this->tenant->getBaseUrl(),
                $this->user
            ));
        }

        return new Client(['handler' => $stack]);
    }
private function createClient ( ) : Client { $ stack = new HandlerStack ( ) ; $ stack -> setHandler ( new CurlHandler ( ) ) ; if ( $ this -> user === null ) { $ stack -> push ( GuzzleJWTMiddleware :: authTokenMiddleware ( $ this -> tenant -> getAddonKey ( ) , $ this -> tenant -> getSharedSecret ( ) ) ) ; } else { $ stack -> push ( GuzzleJWTMiddleware :: authUserTokenMiddleware ( $ this -> tenant -> getOauthClientId ( ) , $ this -> tenant -> getSharedSecret ( ) , $ this -> tenant -> getBaseUrl ( ) , $ this -> user ) ) ; } return new Client ( [ 'handler' => $ stack ] ) ; }
Create a HTTP client

@return Client
Create a HTTP client