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.

BuzzTransport::call()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace Lexik\Bundle\PayboxBundle\Transport;
4
5
use Buzz\Browser;
6
use Buzz\Client\Curl;
7
use Buzz\Message\Response;
8
use Lexik\Bundle\PayboxBundle\Paybox\RequestInterface;
9
10
/**
11
 * Class BuzzTransport
12
 *
13
 * @package Lexik\Bundle\PayboxBundle\Transport
14
 *
15
 * @author Lexik <[email protected]>
16
 * @author Olivier Maisonneuve <[email protected]>
17
 */
18
class BuzzTransport extends AbstractTransport
19
{
20
    /**
21
     * Buzz's curl browser.
22
     *
23
     * @var Browser
24
     */
25
    protected $browser;
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function __construct($url = '')
31
    {
32
        $this->browser = new Browser(new Curl());
33
34
        parent::__construct($url);
35
    }
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    public function call(RequestInterface $request)
41
    {
42
        /**
43
         * @var Response $response
44
         */
45
        $response = $this->browser->submit($this->getEndpoint(), $request->getParameters());
46
47
        if ($response->isSuccessful()) {
48
            return $response->getContent();
49
        } else {
50
            return false;
51
        }
52
    }
53
}
54