UnexpectedTypeException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 1
nop 2
crap 2
1
<?php
2
3
namespace TreeHouse\Feeder\Exception;
4
5
class UnexpectedTypeException extends FeedException
6
{
7
    /**
8
     * @param mixed  $value
9
     * @param string $expectedType
10
     */
11 20
    public function __construct($value, $expectedType)
12
    {
13 20
        parent::__construct(
14 20
            sprintf(
15 20
                'Expected argument of type "%s", "%s" given',
16 20
                $expectedType,
17 20
                is_object($value) ? get_class($value) : gettype($value)
18 20
            )
19 20
        );
20 20
    }
21
}
22