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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A call() 0 13 2
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