for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mrjoops\OAuth2\Client\Provider\Exception;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use Psr\Http\Message\ResponseInterface;
class JiraIdentityProviderException extends IdentityProviderException
{
/**
* Creates client exception from response.
*
* @param ResponseInterface $response
* @param array $data Parsed response data
* @return IdentityProviderException
*/
public static function clientException(ResponseInterface $response, $data)
return static::fromResponse(
$response,
isset($data['message']) ? $data['message'] : $response->getReasonPhrase()
);
}
* Creates oauth exception from response.
public static function oauthException(ResponseInterface $response, $data)
isset($data['error']) ? $data['error'] : $response->getReasonPhrase()
* Creates identity exception from response.
* @param string $message
protected static function fromResponse(ResponseInterface $response, $message = null)
return new static($message, $response->getStatusCode(), (string) $response->getBody());