UnexpectedTypeException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
/*
3
 * This file is part of cwdFancyGridBundle
4
 *
5
 * (c)2017 cwd.at GmbH <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
namespace Cwd\FancyGridBundle\Grid\Exception;
12
13
/**
14
 * Class UnexpectedTypeException
15
 * @package Cwd\FancyGridBundle\Grid\Exception
16
 * @author Ludwig Ruderstaler <[email protected]>
17
 */
18
class UnexpectedTypeException extends InvalidArgumentException
19
{
20
    /**
21
     * UnexpectedTypeException constructor.
22
     * @param string $value
23
     * @param int    $expectedType
24
     */
25
    public function __construct($value, $expectedType)
26
    {
27
        parent::__construct(
28
            sprintf('Expected argument of type "%s", "%s" given',
29
                $expectedType,
30
                is_object($value) ? get_class($value) : gettype($value)
31
            )
32
        );
33
    }
34
}
35