Completed
Push — master ( 59bbf4...e1ffc2 )
by Guillermo A.
01:39
created

AbstractRelationalResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A findBy() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\Highrise\Resources;
4
5
use Guillermoandrae\Common\CollectionInterface;
6
7
abstract class AbstractRelationalResource extends AbstractResource
8
{
9
    /**
10
     * Returns all upcoming tasks assigned to the authenticated user related to
11
     * a person, company, case, or deal.
12
     *
13
     * @param string $name The name of the resource for which tasks should be
14
     *                     returned.
15
     * @param mixed $id The resource ID.
16
     * @param array $filters  The request filters.
17
     * @return CollectionInterface
18
     */
19 1
    public function findBy(string $name, $id, array $filters = []): CollectionInterface
20
    {
21 1
        $uri = sprintf('/%s/%s/%s.xml', $name, $id, $this->getName());
22 1
        return $this->getAdapter()->request('GET', $uri, ['query' => $filters]);
23
    }
24
}
25