Completed
Push — master ( c28851...781c6a )
by Tobias
02:28
created

Imported::getAssets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace FAPI\Localise\Resource\Api\Import;
4
5
use FAPI\Localise\Model\CreatableFromArray;
6
7
/**
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
class Imported implements CreatableFromArray
11
{
12
    /**
13
     * @var array
14
     */
15
    private $assets;
16
17
    /**
18
     * @var array
19
     */
20
    private $locales;
21
22
    private function __construct()
23
    {
24
    }
25
26
    /**
27
     * @param array $data
28
     *
29
     * @return Imported
30
     */
31
    public static function createFromArray(array $data)
32
    {
33
        $self = new self();
34
35
        if (isset($data['assets'])) {
36
            $self->setAssets($data['assets']);
37
        }
38
        if (isset($data['locales'])) {
39
            $self->setLocales($data['locales']);
40
        }
41
42
        return $self;
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function getAssets(): array
49
    {
50
        return $this->assets;
51
    }
52
53
    /**
54
     * @param array $assets
55
     */
56
    private function setAssets($assets)
57
    {
58
        $this->assets = $assets;
59
    }
60
61
    /**
62
     * @return array
63
     */
64
    public function getLocales(): array
65
    {
66
        return $this->locales;
67
    }
68
69
    /**
70
     * @param array $locales
71
     */
72
    private function setLocales($locales)
73
    {
74
        $this->locales = $locales;
75
    }
76
}
77