Completed
Push — master ( 686ecf...037cc5 )
by Guillermo A.
09:28
created

CasesRepository::findAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Guillermoandrae\Highrise\Repositories;
4
5
use Guillermoandrae\Common\Collection;
6
use Guillermoandrae\Common\CollectionInterface;
7
8
final class CasesRepository extends AbstractRepository
0 ignored issues
show
Bug introduced by
The type Guillermoandrae\Highrise...ries\AbstractRepository was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
{
10
    use UnsearchableRepositoryTrait;
11
12
    protected $name = 'kases';
13
14
    public function findAll(array $filters = []): CollectionInterface
15
    {
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
        $results = $this->getAdapter()->request('GET', $uri);
28
        return $this->hydrate($results);
29
    }
30
31
    /**
32
     * Returns all closed cases.
33
     *
34
     * @return CollectionInterface
35
     */
36
    public function findClosed(): CollectionInterface
37
    {
38
        $uri = sprintf('/%s/closed.xml', $this->getName());
39
        $results = $this->getAdapter()->request('GET', $uri);
40
        return $this->hydrate($results);
41
    }
42
}
43