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.

AbstractTransport::checkEndpoint()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.2
c 0
b 0
f 0
cc 4
eloc 3
nc 2
nop 0
1
<?php
2
3
namespace Lexik\Bundle\PayboxBundle\Transport;
4
5
/**
6
 * Class AbstractTransport
7
 *
8
 * @package Lexik\Bundle\PayboxBundle\Transport
9
 *
10
 * @author Fabien Pomerol <[email protected]>
11
 */
12
abstract class AbstractTransport implements TransportInterface
13
{
14
    /**
15
     * This is what the transport will point. Can be an url or a path (depends
16
     * what transport you use, cURL or Shell)
17
     *
18
     * @var string $endpoint Url or Path
19
     */
20
    protected $endpoint;
21
22
    /**
23
     * Construct the object
24
     *
25
     * @param string $endpoint to paybox endpoint
26
     */
27
    public function __construct($endpoint = '')
28
    {
29
        $this->endpoint = $endpoint;
30
    }
31
32
    /**
33
     * Define the endpoint. It can be an url or a path, depends what control you
34
     * choose.
35
     *
36
     * @param string $endpoint to paybox endpoint
37
     */
38
    public function setEndpoint($endpoint)
39
    {
40
        if (!is_string($endpoint)) {
41
            throw new \InvalidArgumentException('$endpoint must be a string.');
42
        }
43
44
        $this->endpoint = $endpoint;
45
    }
46
47
    /**
48
     * Get the paybox endpoint.
49
     *
50
     * @return string
51
     */
52
    public function getEndpoint()
53
    {
54
        return $this->endpoint;
55
    }
56
57
    /**
58
     * Perform a call
59
     *
60
     * @throws \RuntimeException If no endpoint defined
61
     */
62
    protected function checkEndpoint()
63
    {
64
        if ($this->endpoint == '' || null === $this->endpoint || empty($this->endpoint)) {
65
            throw new \RunTimeException('No endpoint defined.');
66
        }
67
    }
68
}
69