Completed
Push — master ( 95511f...95c895 )
by Peter
03:25
created

ResponseException::failed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * AnimeDb package.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\ShikimoriBrowserBundle\Service\Exception;
12
13
class ResponseException extends \RuntimeException
14
{
15
    /**
16
     * @param string $host
17
     *
18
     * @return ResponseException
19
     */
20 5
    public static function failed($host)
21
    {
22 5
        return new self(sprintf('Failed to query the server "%s"', $host));
23
    }
24
25
    /**
26
     * @param string $host
27
     *
28
     * @return ResponseException
29
     */
30 5
    public static function invalidResponse($host)
31
    {
32 5
        return new self(sprintf('Invalid response from the server "%s"', $host));
33
    }
34
}
35