Failed Conditions
Push — master ( 2fcedf...efe7fa )
by Guillermo A.
01:42
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 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findClosed() 0 4 1
A findOpen() 0 4 1
A findAll() 0 3 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 1
12
    protected $name = 'kases';
13 1
14 1
    public function findAll(array $options = []): CollectionInterface
15 1
    {
16
        return $this->findOpen();
17
    }
18
19
    /**
20
     * Returns all open cases.
21
     *
22
     * @return CollectionInterface
23
     */
24
    public function findOpen(): CollectionInterface
25
    {
26
        $uri = sprintf('/%s/open.xml', $this->getName());
27
        return $this->getAdapter()->request('GET', $uri);
28
    }
29
30
    /**
31
     * Returns all closed cases.
32
     *
33
     * @return CollectionInterface
34
     */
35
    public function findClosed(): CollectionInterface
36
    {
37
        $uri = sprintf('/%s/closed.xml', $this->getName());
38
        return $this->getAdapter()->request('GET', $uri);
39
    }
40
}
41