OnCallsRepository::users()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Shrikeh\PagerDuty\Repository\OnCalls;
4
5
use Shrikeh\PagerDuty\Client;
6
use Shrikeh\PagerDuty\Parser;
7
use Shrikeh\PagerDuty\Repository\OnCalls;
8
use Shrikeh\PagerDuty\Parser\OnCall as OnCallParser;
9
10
class OnCallsRepository implements OnCalls
11
{
12
    private $client;
13
14
    private $parser;
15
16
    public function __construct(
17
        Client $client,
18
        OnCallParser $parser
19
    ) {
20
        $this->client   = $client;
21
        $this->parser   = $parser;
22
    }
23
24
    public function get()
25
    {
26
        return $this->parser->parseResponse($this->client->request(
27
            'GET',
28
            static::ENDPOINT
29
        ));
30
    }
31
32
    public function users()
33
    {
34
      return $this->parser->parseResponse($this->client->request(
35
          'GET',
36
          static::ENDPOINT,
37
          ['query' => 'include[]=users']
38
      ));
39
    }
40
}
41