Completed
Push — master ( 1008a1...9cabe1 )
by Tobias
01:30
created

LocoProject   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 52
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getApiKey() 0 4 1
A getIndexParameter() 0 4 1
1
<?php
2
3
namespace Translation\PlatformAdapter\Loco\Model;
4
5
/**
6
 * Represents a project from loco
7
 */
8
final class LocoProject
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var string
17
     */
18
    private $apiKey;
19
20
    /**
21
     * @var string
22
     */
23
    private $indexParameter;
24
25
    /**
26
     * @param string $name
27
     * @param array $config
28
     */
29 3
    public function __construct(string $name, array $config)
30
    {
31 3
        $this->name = $name;
32 3
        $this->apiKey = $config['api_key'];
33 3
        $this->indexParameter = $config['index_parameter'];
34 3
    }
35
36
    /**
37
     * @return string
38
     */
39 1
    public function getName()
40
    {
41 1
        return $this->name;
42
    }
43
44
    /**
45
     * @return string|null
46
     */
47 1
    public function getApiKey()
48
    {
49 1
        return $this->apiKey;
50
    }
51
52
    /**
53
     * @return string|null
54
     */
55 1
    public function getIndexParameter()
56
    {
57 1
        return $this->indexParameter;
58
    }
59
}
60