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

ClientException::validation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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