Completed
Push — master ( 13e315...f7f936 )
by Chiribuc
07:25 queued 11s
created

Teamwork   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 48
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DigitalEquation\Teamwork;
4
5
use DigitalEquation\Teamwork\Services\Desk;
6
use DigitalEquation\Teamwork\Services\HelpDocs;
7
use DigitalEquation\Teamwork\Services\Tickets;
8
use GuzzleHttp\Client;
9
10
class Teamwork
11
{
12
    /**
13
     * @var \GuzzleHttp\Client
14
     */
15
    protected Client $client;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
16
17
    /**
18
     * ApiClient constructor.
19
     */
20
    public function __construct()
21
    {
22
        $this->client = new Client([
23
            'base_uri' => sprintf('https://%s.teamwork.com/desk/v1/', config('teamwork.desk.domain')),
24
            'auth'     => [config('teamwork.desk.key'), ''],
25
        ]);
26
    }
27
28
    /**
29
     * Teamwork Desk.
30
     *
31
     * @return Desk
32
     */
33
    public function desk(): Desk
34
    {
35
        return new Desk($this->client);
36
    }
37
38
    /**
39
     * Teamwork HelpDocs.
40
     *
41
     * @return HelpDocs
42
     */
43
    public function helpDocs(): HelpDocs
44
    {
45
        return new HelpDocs($this->client);
46
    }
47
48
    /**
49
     * Teamwork Tickets.
50
     *
51
     * @return Tickets
52
     */
53
    public function tickets(): Tickets
54
    {
55
        return new Tickets($this->client);
56
    }
57
}
58