Completed
Push — master ( 3cb300...cba459 )
by Tobias
03:38
created

SimpleMatch::createFromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Happyr\ApiClient\Model\Match;
4
5
use Happyr\ApiClient\Model\CreatableFromArray;
6
7
/**
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
final class SimpleMatch implements CreatableFromArray
11
{
12
    /**
13
     * @var array
14
     */
15
    private $matches;
16
17
    /**
18
     * @param array $matches
19
     */
20
    private function __construct(array $matches)
21
    {
22
        $this->matches = $matches;
23
    }
24
25
    /**
26
     * @param array $data
27
     *
28
     * @return
29
     */
30
    public static function createFromArray(array $data)
31
    {
32
        return new self($data['data']);
33
    }
34
35
    /**
36
     * @return array
37
     */
38
    public function getMatches()
39
    {
40
        return $this->matches;
41
    }
42
}
43