GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UnprocessableEntityHttpException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResponseErrors() 0 7 2
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaignApi\Exception;
7
8
/**
9
 * Class UnprocessableEntityHttpException
10
 */
11
class UnprocessableEntityHttpException extends ClientErrorHttpException
12
{
13
    /**
14
     * Returns the errors of the response if there are any
15
     */
16
    public function getResponseErrors(): array
17
    {
18
        $responseBody = $this->response->getBody();
19
        $responseBody->rewind();
20
        $decodedBody = json_decode($responseBody->getContents(), true);
21
        $responseBody->rewind();
22
        return isset($decodedBody['errors']) ? $decodedBody['errors'] : [];
23
    }
24
}
25