TriggerException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 23
wmc 1
lcom 0
cbo 2
ccs 0
cts 10
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
1
<?php
2
namespace ApigilityClient\Http\Response;
3
4
use Zend\Http\Client as ZendHttpClient,
5
    Zend\Http\Response as ZendHttpResponse;
6
7
use ApigilityClient\Exception\RuntimeException;
8
9
class TriggerException
10
{
11
12
    /**
13
     * Throws an exception
14
     *
15
     * @param  Zend\Http\Client   $client
16
     * @param  Zend\Http\Response $response
17
     * @param  string|null        $message
18
     * @throws ApigilityClient\Exception\RuntimeException
19
     */
20
    public function __construct(ZendHttpClient $client, ZendHttpResponse $response, $message = null)
0 ignored issues
show
Unused Code introduced by
The parameter $client is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $message is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
        $error = json_decode($response->getBody());
23
24
        throw new RuntimeException(sprintf(
25
            'Erro "%s/%s". %s',
26
            $error->status,
27
            $error->title,
28
            $error->detail
29
        ));
30
    }
31
}
32