AccountRepository::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Guillermoandrae\Highrise\Repositories;
4
5
use BadMethodCallException;
6
use Guillermoandrae\Common\CollectionInterface;
7
use Guillermoandrae\Highrise\Models\ModelInterface;
8
use Guillermoandrae\Models\ModelInterface as BaseModelInterface;
9
use Guillermoandrae\Repositories\ReadOnlyRepositoryTrait;
10
11
class AccountRepository extends AbstractRepository
12
{
13
    use UnsearchableRepositoryTrait, ReadOnlyRepositoryTrait {
14
        UnsearchableRepositoryTrait::callUnsupportedMethod insteadof ReadOnlyRepositoryTrait;
15
    }
16
17
    protected $name = 'account';
18
19
    /**
20
     * Returns account information.
21
     *
22
     * @return ModelInterface
23
     */
24
    public function show(): ModelInterface
25
    {
26
        $result = $this->getAdapter()->request('GET', '/account.xml');
27
        return $this->hydrate($result);
28
    }
29
30
    public function findById($id): BaseModelInterface
31
    {
32
        return $this->callUnsupportedMethod('findById');
33
    }
34
35
    public function findAll(int $offset = 0, int $limit = null): CollectionInterface
36
    {
37
        return $this->callUnsupportedMethod('findAll');
38
    }
39
}
40