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.

ValidationException::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * This file is part of the ReCaptcha Library.
4
 *
5
 * (c) Ilya Pokamestov <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
*/
10
11
namespace DS\Library\ReCaptcha;
12
13
use Psr\Http\Message\RequestInterface;
14
use Psr\Http\Message\ResponseInterface;
15
16
/**
17
 * ReCaptcha library, validation exception.
18
 *
19
 * @author Ilya Pokamestov <[email protected]>
20
 */
21
class ValidationException extends \Exception
22
{
23
    /** @var array */
24
    protected $errors = array();
25
    /** @var  RequestInterface */
26
    protected $request;
27
    /** @var  ResponseInterface */
28
    protected $response;
29
30 2
    public function __construct(
31
        array $errors,
32
        ResponseInterface $response = null,
33
        RequestInterface $request = null,
34
        $message = '',
35
        $code = 0,
36
        \Exception $previous = null
37
    ) {
38 2
        $this->errors = $errors;
39 2
        $this->request = $request;
40 2
        $this->response = $response;
41
42 2
        if ('' === $message) {
43 2
            $message = sprintf('Verification failed with errors: %s', implode(';', $errors));
44 2
        }
45
46 2
        parent::__construct($message, $code, $previous);
47 2
    }
48
49
    /**
50
     * @return RequestInterface
51
     */
52 1
    public function getRequest()
53
    {
54 1
        return $this->request;
55
    }
56
57
    /**
58
     * @return ResponseInterface
59
     */
60 1
    public function getResponse()
61
    {
62 1
        return $this->response;
63
    }
64
65
    /**
66
     * @return array
67
     */
68 1
    public function getErrors()
69
    {
70 1
        return $this->errors;
71
    }
72
}
73