Region   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A list() 0 12 1
1
<?php
2
/*
3
 *   This file is part of the Vultr PHP library.
4
 *
5
 *   (c) Albert Leitato <[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
namespace Vultr\Api;
11
12
use Vultr\Entity\Region as RegionEntity;
13
14
/**
15
 * @author Albert Leitato <[email protected]>
16
 */
17
class Region extends AbstractApi
18
{
19
    /**
20
     * @return RegionEntity[]
21
     */
22
    public function list($availability = null)
23
    {
24
        $regions = $this->adapter->get(\sprintf('%s/regions/list?availability=%d', $this->endpoint, $availability));
25
26
        $regions = \json_decode($regions);
27
28
        $this->extractMeta($regions);
0 ignored issues
show
Bug introduced by
The method extractMeta() does not seem to exist on object<Vultr\Api\Region>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
30
        return \array_map(function ($region) {
31
            return new RegionEntity($region);
32
        }, $regions->regions);
33
    }
34
}
35