BadRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 2 Features 0
Metric Value
eloc 4
c 4
b 2
f 0
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 3
1
<?php
2
3
namespace Srmklive\Dropbox\Exceptions;
4
5
use Exception;
6
use Psr\Http\Message\ResponseInterface;
7
8
class BadRequest extends Exception
9
{
10
    /**
11
     * BadRequest constructor.
12
     *
13
     * @param ResponseInterface $response
14
     */
15 11
    public function __construct(ResponseInterface $response)
16
    {
17 11
        $body = json_decode($response->getBody(), true);
18
19 11
        if (null !== $body && true === isset($body['error_summary'])) {
20 1
            parent::__construct($body['error_summary']);
21
        }
22 11
    }
23
}
24