Passed
Push — master ( 0676a7...01ab94 )
by Artem
11:54
created

AuthorizedAppRepository::getSupportedFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 10
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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\Profile\Repository;
13
14
use Linode\Entity;
15
use Linode\Internal\AbstractRepository;
16
use Linode\Profile\AuthorizedApp;
17
use Linode\Profile\AuthorizedAppRepositoryInterface;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class AuthorizedAppRepository extends AbstractRepository implements AuthorizedAppRepositoryInterface
23
{
24
    public function deleteProfileApp(int $appId): void
25
    {
26
        $this->client->delete(sprintf('%s/%s', $this->getBaseUri(), $appId));
27
    }
28
29
    protected function getBaseUri(): string
30
    {
31
        return '/profile/apps';
32
    }
33
34
    protected function getSupportedFields(): array
35
    {
36
        return [
37
            AuthorizedApp::FIELD_ID,
38
            AuthorizedApp::FIELD_LABEL,
39
            AuthorizedApp::FIELD_SCOPES,
40
            AuthorizedApp::FIELD_WEBSITE,
41
            AuthorizedApp::FIELD_CREATED,
42
            AuthorizedApp::FIELD_EXPIRY,
43
            AuthorizedApp::FIELD_THUMBNAIL_URL,
44
        ];
45
    }
46
47
    protected function jsonToEntity(array $json): Entity
48
    {
49
        return new AuthorizedApp($this->client, $json);
50
    }
51
}
52