AccountRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findById() 0 3 1
A show() 0 4 1
A findAll() 0 3 1
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