MissingResponseException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of Transfer.
5
 *
6
 * For the full copyright and license information, please view the LICENSE file located
7
 * in the root directory.
8
 */
9
10
namespace Transfer\Exception;
11
12
use Transfer\Adapter\SourceAdapterInterface;
13
use Transfer\Adapter\TargetAdapterInterface;
14
15
/**
16
 * Exception class for cases when a response is missing.
17
 */
18
class MissingResponseException extends \Exception
19
{
20
    /**
21
     * @param SourceAdapterInterface|TargetAdapterInterface $adapter Adapter object
22
     */
23 2
    public function __construct($adapter)
24
    {
25 2
        if (is_object($adapter)) {
26 2
            $adapter = get_class($adapter);
27 2
        }
28
29 2
        parent::__construct(sprintf('Adapter %s must return a Response, null given', $adapter));
30 2
    }
31
}
32