Completed
Pull Request — master (#14)
by Benoît
04:37
created

UnexpectedTypeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
/*
3
 * This file is part of Phraseanet
4
 *
5
 * (c) 2005-2015 Alchemy
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Webmozart\Json;
11
12
class UnexpectedTypeException extends \InvalidArgumentException
13
{
14
    /**
15
     * UnexpectedTypeException constructor.
16
     *
17
     * @param string $value
18
     * @param int    $expectedType
19
     */
20 1
    public function __construct($value, $expectedType)
21
    {
22 1
        parent::__construct(sprintf(
23 1
            'Expected argument of type "%s", "%s" given',
24 1
            $expectedType,
25 1
            is_object($value) ? get_class($value) : gettype($value)
26 1
        ));
27 1
    }
28
}
29