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

ObjectStorageClusterRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 21
ccs 12
cts 12
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaseUri() 0 3 1
A getSupportedFields() 0 8 1
A jsonToEntity() 0 3 1
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