Completed
Push — master ( 652e57...3ec9c1 )
by Max
03:33
created

JSONParser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 3 1
1
<?php
2
3
namespace NFLScores\Utilities;
4
5
use NFLScores\Interfaces\ParserInterface;
6
7
/**
8
 * Parse JSON strings.
9
 */
10
class JSONParser implements ParserInterface
11
{
12
    /**
13
     * Converts a JSON string to array.
14
     *
15
     * @param string $data
16
     *
17
     * @return array
18
     */
19 3
    public static function parse(string $data): array
20
    {
21 3
        return json_decode($data, true);
22
    }
23
}
24