UnexpectedTypeException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 6
c 2
b 1
f 1
dl 0
loc 15
ccs 0
cts 5
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace ByTIC\MediaLibrary\Exceptions;
4
5
/**
6
 * Class UnexpectedTypeException.
7
 */
8
class UnexpectedTypeException extends ValidatorException
9
{
10
    /**
11
     * UnexpectedTypeException constructor.
12
     *
13
     * @param string $value
14
     * @param int    $expectedType
15
     */
16
    public function __construct($value, $expectedType)
17
    {
18
        parent::__construct(
19
            sprintf(
20
                'Expected argument of type "%s", "%s" given',
21
                $expectedType,
22
                is_object($value) ? get_class($value) : gettype($value)
0 ignored issues
show
introduced by
The condition is_object($value) is always false.
Loading history...
23
            )
24
        );
25
    }
26
}
27