__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 6
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Thruster\Component\DataMapper\Exception;
4
5
use Thruster\Component\DataMapper\DataMapperInterface;
6
7
/**
8
 * Class NotSupportedInputForDataMapperException
9
 *
10
 * @package Thruster\Component\DataMapper\Exception
11
 * @author  Aurimas Niekis <[email protected]>
12
 */
13
class NotSupportedInputForDataMapperException extends \Exception
14
{
15
    /**
16
     * @inheritDoc
17
     */
18 1
    public function __construct($input, DataMapperInterface $dataMapper)
19
    {
20 1
        $message = sprintf(
21 1
            'DataMapper "%s" does not support input type "%s"',
22
            get_class($dataMapper),
23 1
            is_object($input) ? get_class($input) : gettype($input)
24
        );
25
26 1
        parent::__construct($message);
27 1
    }
28
}
29