Passed
Push — master ( f0f514...a1b81d )
by Artem
01:46
created

BetaProgramRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 1
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupportedFields() 0 10 1
A getBaseUri() 0 3 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 <https://opensource.org/licenses/MIT>.
9
//
10
// ---------------------------------------------------------------------
11
12
namespace Linode\BetaPrograms\Repository;
13
14
use Linode\BetaPrograms\BetaProgram;
15
use Linode\BetaPrograms\BetaProgramRepositoryInterface;
16
use Linode\Entity;
17
use Linode\Internal\AbstractRepository;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class BetaProgramRepository extends AbstractRepository implements BetaProgramRepositoryInterface
23
{
24
    protected function getBaseUri(): string
25
    {
26
        return '/betas';
27
    }
28
29
    protected function getSupportedFields(): array
30
    {
31
        return [
32
            BetaProgram::FIELD_ID,
33
            BetaProgram::FIELD_LABEL,
34
            BetaProgram::FIELD_DESCRIPTION,
35
            BetaProgram::FIELD_GREENLIGHT_ONLY,
36
            BetaProgram::FIELD_STARTED,
37
            BetaProgram::FIELD_ENDED,
38
            BetaProgram::FIELD_MORE_INFO,
39
        ];
40
    }
41
42
    protected function jsonToEntity(array $json): Entity
43
    {
44
        return new BetaProgram($this->client, $json);
45
    }
46
}
47