Completed
Push — master ( b2db07...6ada9a )
by luca
08:41
created

ClientException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A failed() 0 4 1
A validation() 0 4 1
1
<?php
2
3
namespace Audiens\DoubleclickClient\exceptions;
4
5
use Audiens\DoubleclickClient\entity\ApiResponse;
6
7
/**
8
 * Class UserListException
9
 */
10
class ClientException extends \Exception
11
{
12
13
    /**
14
     * @param ApiResponse $apiResponse
15
     *
16
     * @return self
17
     */
18
    public static function failed(ApiResponse $apiResponse)
19
    {
20
        return new self('Failed call: '.$apiResponse->getError());
21
    }
22
23
    /**
24
     * @param $message
25
     * @return ClientException
26
     */
27
    public static function validation($message)
28
    {
29
        return new self($message);
30
    }
31
}
32