InvoiceRepository::getSupportedFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 11
rs 9.9666
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\Account\Repository;
13
14
use Linode\Account\Invoice;
15
use Linode\Account\InvoiceRepositoryInterface;
16
use Linode\Entity;
17
use Linode\Internal\AbstractRepository;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class InvoiceRepository extends AbstractRepository implements InvoiceRepositoryInterface
23
{
24
    protected function getBaseUri(): string
25
    {
26
        return '/account/invoices';
27
    }
28
29
    protected function getSupportedFields(): array
30
    {
31
        return [
32
            Invoice::FIELD_ID,
33
            Invoice::FIELD_DATE,
34
            Invoice::FIELD_LABEL,
35
            Invoice::FIELD_SUBTOTAL,
36
            Invoice::FIELD_BILLING_SOURCE,
37
            Invoice::FIELD_TAX,
38
            Invoice::FIELD_TOTAL,
39
            Invoice::FIELD_TAX_SUMMARY,
40
        ];
41
    }
42
43
    protected function jsonToEntity(array $json): Entity
44
    {
45
        return new Invoice($this->client, $json);
46
    }
47
}
48