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.
Passed
Push — master ( 307cce...27531d )
by Jamie
04:17 queued 15s
created

Entry   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 6
c 3
b 1
f 1
lcom 2
cbo 1
dl 0
loc 43
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 4 2
A getEndpointUrl() 0 10 4
1
<?php
2
3
namespace OpenStack\Identity\v2\Models;
4
5
use OpenStack\Common\Resource\AbstractResource;
6
7
/**
8
 * Represents an Identity v2 Catalog Entry.
9
 *
10
 * @package OpenStack\Identity\v2\Models
11
 */
12
class Entry extends AbstractResource
13
{
14
    /** @var string */
15
    public $name;
16
17
    /** @var string */
18
    public $type;
19
20
    /** @var []Endpoint */
21
    public $endpoints = [];
22
23
    /**
24
     * Indicates whether this catalog entry matches a certain name and type.
25
     *
26
     * @param string $name
27
     * @param string $type
28
     *
29
     * @return bool TRUE if it's a match, FALSE if not
30
     */
31 1
    public function matches($name, $type)
32
    {
33 1
        return $this->name == $name && $this->type == $type;
34
    }
35
36
    /**
37
     * Retrieves the catalog entry's URL according to a specific region and URL type
38
     *
39
     * @param string $region
40
     * @param string $urlType
41
     *
42
     * @return string|null
43
     */
44 2
    public function getEndpointUrl($region, $urlType)
45
    {
46 2
        foreach ($this->endpoints as $endpoint) {
47 1
            if ($endpoint->supportsRegion($region) && $endpoint->supportsUrlType($urlType)) {
48 1
                return $endpoint->getUrl($urlType);
49
            }
50 1
        }
51
52 1
        return null;
53
    }
54
}
55