ApiFactory::clientApi()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify;
6
7
use JDecool\Clockify\{
8
    Api\Client\Client as ClientApi,
9
    Api\Project\Project,
10
    Api\Tag\Tag,
11
    Api\Task\Task,
12
    Api\TimeEntry\TimeEntry,
13
    Api\User\User,
14
    Api\Workspace\Workspace
15
};
16
17
class ApiFactory
18
{
19
    private $client;
20
21
    public function __construct(Client $client)
22
    {
23
        $this->client = $client;
24
    }
25
26
    public function clientApi(): ClientApi
27
    {
28
        return new ClientApi($this->client);
29
    }
30
31
    public function projectApi(): Project
32
    {
33
        return new Project($this->client);
34
    }
35
36
    public function tagApi(): Tag
37
    {
38
        return new Tag($this->client);
39
    }
40
41
    public function taskApi(): Task
42
    {
43
        return new Task($this->client);
44
    }
45
46
    public function timeEntryApi(): TimeEntry
47
    {
48
        return new TimeEntry($this->client);
49
    }
50
51
    public function userApi(): User
52
    {
53
        return new User($this->client);
54
    }
55
56
    public function workspaceApi(): Workspace
57
    {
58
        return new Workspace($this->client);
59
    }
60
}
61