Passed
Push — master ( 929753...8f50c7 )
by Jérémy
01:46
created

ApiFactory::projectApi()   A

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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\Workspace\Workspace
13
};
14
15
class ApiFactory
16
{
17
    private $client;
18
19
    public function __construct(Client $client)
20
    {
21
        $this->client = $client;
22
    }
23
24
    public function clientApi(): ClientApi
25
    {
26
        return new ClientApi($this->client);
27
    }
28
29
    public function projectApi(): Project
30
    {
31
        return new Project($this->client);
32
    }
33
34
    public function tagApi(): Tag
35
    {
36
        return new Tag($this->client);
37
    }
38
39
    public function taskApi(): Task
40
    {
41
        return new Task($this->client);
42
    }
43
44
    public function workspaceApi(): Workspace
45
    {
46
        return new Workspace($this->client);
47
    }
48
}
49