Completed
Push — master ( efe7fa...260da8 )
by Guillermo A.
01:44
created

Cases   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findAll() 0 3 1
A findClosed() 0 4 1
A findOpen() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\Highrise\Resources;
4
5
use Guillermoandrae\Common\Collection;
6
use Guillermoandrae\Common\CollectionInterface;
7
8
final class Cases extends AbstractResource
9
{
10
    use UnsearchableResourceTrait;
11
12
    protected $name = 'kases';
13
14 1
    public function findAll(array $options = []): CollectionInterface
15
    {
16 1
        return $this->findOpen();
17
    }
18
19
    /**
20
     * Returns all open cases.
21
     *
22
     * @return CollectionInterface
23
     */
24 2
    public function findOpen(): CollectionInterface
25
    {
26 2
        $uri = sprintf('/%s/open.xml', $this->getName());
27 2
        return $this->getAdapter()->request('GET', $uri);
28
    }
29
30
    /**
31
     * Returns all closed cases.
32
     *
33
     * @return CollectionInterface
34
     */
35 1
    public function findClosed(): CollectionInterface
36
    {
37 1
        $uri = sprintf('/%s/closed.xml', $this->getName());
38 1
        return $this->getAdapter()->request('GET', $uri);
39
    }
40
}
41