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

LocoProject::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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