Passed
Push — master ( 2c24c4...fb6e78 )
by Artem
01:55
created

ObjectStorageClusterRepository::getBaseUri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
// ---------------------------------------------------------------------
4
//
5
//  Copyright (C) 2018-2024 Artem Rodygin
6
//
7
//  You should have received a copy of the MIT License along with
8
//  this file. If not, see <http://opensource.org/licenses/MIT>.
9
//
10
// ---------------------------------------------------------------------
11
12
namespace Linode\Internal\ObjectStorage;
13
14
use Linode\Entity\Entity;
15
use Linode\Entity\ObjectStorage\ObjectStorageCluster;
16
use Linode\Internal\AbstractRepository;
17
use Linode\Repository\ObjectStorage\ObjectStorageClusterRepositoryInterface;
18
19
class ObjectStorageClusterRepository extends AbstractRepository implements ObjectStorageClusterRepositoryInterface
20
{
21 1
    protected function getBaseUri(): string
22
    {
23 1
        return 'beta/object-storage/clusters';
24
    }
25
26 1
    protected function getSupportedFields(): array
27
    {
28 1
        return [
29 1
            ObjectStorageCluster::FIELD_ID,
30 1
            ObjectStorageCluster::FIELD_DOMAIN,
31 1
            ObjectStorageCluster::FIELD_STATUS,
32 1
            ObjectStorageCluster::FIELD_REGION,
33 1
            ObjectStorageCluster::FIELD_SITE_DOMAIN,
34 1
        ];
35
    }
36
37 1
    protected function jsonToEntity(array $json): Entity
38
    {
39 1
        return new ObjectStorageCluster($this->client, $json);
40
    }
41
}
42