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

Cases::findClosed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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