Passed
Push — master ( 6e7a8b...a8bcd9 )
by Alessandro
03:35 queued 01:32
created

Response   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TrelloCycleTime\Client\Message;
6
7
use TrelloCycleTime\Exception\InvalidJsonException;
8
9
class Response
10
{
11 2
    public static function validate($jsonString)
12
    {
13 2
        $json = json_decode($jsonString, true);
14
15 2
        if (json_last_error() !== JSON_ERROR_NONE) {
16 1
            throw new InvalidJsonException(json_last_error_msg(), json_last_error());
17
        }
18
19 1
        return $json;
20
    }
21
}